Remove unneeded CFStringRef allocations in CFURL. #205

Merged
merged 4 commits into from Jan 6, 2016

Conversation

Projects
None yet
3 participants
@DarrylBayliss
Contributor

DarrylBayliss commented Jan 2, 2016

Tiny refactoring of some unneeded code.

@DarrylBayliss DarrylBayliss changed the title from Remove unneeded CFStringRef allocations. to Remove unneeded CFStringRef allocations in CFURL. Jan 2, 2016

@phausler

View changes

CoreFoundation/URL.subproj/CFURL.c
- CFStringRef substring = CFStringCreateWithSubstring(alloc, originalString, CFRangeMake(mark, percentRange.location - mark));
- CFStringAppend(newStr, substring);
- CFRelease(substring);
+ CFStringAppend(newStr, CFStringCreateWithSubstring(alloc, originalString, CFRangeMake(mark, percentRange.location - mark)));

This comment has been minimized.

@phausler

phausler Jan 2, 2016

Member

This is still allocating a new string and now is leaking

@phausler

phausler Jan 2, 2016

Member

This is still allocating a new string and now is leaking

phausler added a commit that referenced this pull request Jan 6, 2016

Merge pull request #205 from DarrylBayliss/master
Remove unneeded CFStringRef allocations in CFURL.

@phausler phausler merged commit 231dae1 into apple:master Jan 6, 2016

millenomi pushed a commit to millenomi/swift-corelibs-foundation that referenced this pull request Jan 8, 2018

Merge pull request #205 from ktopley-apple/dispatch-corelibs-async-fixit
Correct the Xcode fixits for dispatch_async() and dispatch_group_async()

millenomi pushed a commit to millenomi/swift-corelibs-foundation that referenced this pull request Jan 8, 2018

Merge pull request #205 from ktopley-apple/dispatch-corelibs-async-fixit
Correct the Xcode fixits for dispatch_async() and dispatch_group_async()

Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment