WebKit icon indicating copy to clipboard operation
WebKit copied to clipboard

Prefer CFStringCreateWithCString over CFStringCreateWithBytes if we don't have the size

Open AZero13 opened this issue 1 year ago โ€ข 34 comments

Prefer CFStringCreateWithCString over CFStringCreateWithBytes if we don't have the size
https://bugs.webkit.org/show_bug.cgi?id=279157

Reviewed by NOBODY (OOPS!).

It is more efficient that way.

* Source/WebCore/platform/text/mac/TextBoundaries.mm:
(WebCore::tokenizerForString): CFStringCreateWithCStringNoCopy.

https://github.com/WebKit/WebKit/commit/bd5ead2c0f2c33b10587a70bcd6186fb02b51a7c

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
โœ… ๐Ÿงช style โœ… ๐Ÿ›  ios โœ… ๐Ÿ›  mac โœ… ๐Ÿ›  wpe โœ… ๐Ÿ›  win
โœ… ๐Ÿงช bindings โœ… ๐Ÿ›  ios-sim โœ… ๐Ÿ›  mac-AS-debug โœ… ๐Ÿงช wpe-wk2 โœ… ๐Ÿงช win-tests
โœ… ๐Ÿงช webkitperl โœ… ๐Ÿงช ios-wk2 โœ… ๐Ÿงช api-mac โœ… ๐Ÿงช api-wpe
โœ… ๐Ÿงช ios-wk2-wpt โœ… ๐Ÿงช mac-wk1 โœ… ๐Ÿ›  wpe-cairo
โœ… ๐Ÿ›  ๐Ÿงช jsc โœ… ๐Ÿงช api-ios โœ… ๐Ÿงช mac-wk2 โœ… ๐Ÿ›  gtk
โœ… ๐Ÿ›  ๐Ÿงช jsc-arm64 โœ… ๐Ÿ›  vision โœ… ๐Ÿงช mac-AS-debug-wk2 โœ… ๐Ÿงช gtk-wk2
โœ… ๐Ÿ›  vision-sim โœ… ๐Ÿงช mac-wk2-stress โœ… ๐Ÿงช api-gtk
โœ… ๐Ÿงช vision-wk2 โœ… ๐Ÿงช mac-intel-wk2 โœ… ๐Ÿ›  jsc-armv7
โœ… ๐Ÿ›  tv โœ… ๐Ÿ›  mac-safer-cpp โœ… ๐Ÿงช jsc-armv7-tests
โœ… ๐Ÿ›  tv-sim
โœ… ๐Ÿ›  watch
โœ… ๐Ÿ›  watch-sim

AZero13 avatar Sep 04 '24 23:09 AZero13

Note: This PR originally changed https://github.com/WebKit/WebKit/pull/33161 to using the GetBytes since we have the size, but we can make a literal instead so I split that out from this.

AZero13 avatar Sep 13 '24 18:09 AZero13

This PR is staying as is and can be merged by the way.

AZero13 avatar Sep 13 '24 18:09 AZero13

@achristensen07 Can we please merge this?

AZero13 avatar Sep 22 '24 16:09 AZero13

I'm not sure it's a more efficient way, but it's certainly a different way to do the same thing.

achristensen07 avatar Sep 26 '24 06:09 achristensen07

@achristensen07 Can we please merge this?

AZero13 avatar Oct 12 '24 16:10 AZero13