Revision: 28637
http://sourceforge.net/p/bibdesk/svn/28637
Author: hofman
Date: 2024-01-21 17:42:39 +0000 (Sun, 21 Jan 2024)
Log Message:
-----------
No advantage in returning copied value with ARC
Modified Paths:
--------------
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageCache.m
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCacheFile.h
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCacheFile.mm
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVInvocationOperation.h
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVInvocationOperation.m
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageCache.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageCache.m 2024-01-21
17:34:04 UTC (rev 28636)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageCache.m 2024-01-21
17:42:39 UTC (rev 28637)
@@ -97,7 +97,7 @@
- (CGImageRef)newImageForKey:(id)aKey;
{
- NSData *data = [_cacheFile copyDataForKey:aKey];
+ NSData *data = [_cacheFile dataForKey:aKey];
CGImageRef image = FVCreateCGImageWithData(data);
return image;
}
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCacheFile.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCacheFile.h 2024-01-21
17:34:04 UTC (rev 28636)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCacheFile.h 2024-01-21
17:42:39 UTC (rev 28637)
@@ -78,7 +78,7 @@
@param aKey The key to read.
@return Previously stored data or nil if the cache had no value for the
specified key. */
-- (NSData *)copyDataForKey:(id)aKey;
+- (NSData *)dataForKey:(id)aKey;
/** Invalidate cached data.
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCacheFile.mm
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCacheFile.mm 2024-01-21
17:34:04 UTC (rev 28636)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCacheFile.mm 2024-01-21
17:42:39 UTC (rev 28637)
@@ -368,7 +368,7 @@
[_writeLock unlock];
}
-- (NSData *)copyDataForKey:(id)aKey;
+- (NSData *)dataForKey:(id)aKey;
{
FVAPIAssert1(-1 != _fileDescriptor, @"Attempt to read from a file %@ that
has already been closed", self);
@@ -440,7 +440,7 @@
data =
(id)CFBridgingRelease(CFDataCreateWithBytesNoCopy(CFAllocatorGetDefault(),
(const uint8_t *)bytes, location->_decompressedLength,
FVAllocatorGetDefault()));
}
else {
- FVLog(@"Unable to malloc %ld bytes in -[FVCacheFile
copyDataForKey:] with key %@", (unsigned long)location->_decompressedLength,
aKey);
+ FVLog(@"Unable to malloc %ld bytes in -[FVCacheFile dataForKey:]
with key %@", (unsigned long)location->_decompressedLength, aKey);
}
NSParameterAssert([data length] == location->_decompressedLength);
@@ -453,7 +453,7 @@
- (void)invalidateDataForKey:(id)aKey;
{
[_writeLock lock];
- // give copyDataForKey: a chance to get/retain
+ // give dataForKey: a chance to get/retain
FVRetainAutorelease([_offsetTable objectForKey:aKey]);
[_offsetTable removeObjectForKey:aKey];
[_writeLock unlock];
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVInvocationOperation.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVInvocationOperation.h
2024-01-21 17:34:04 UTC (rev 28636)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVInvocationOperation.h
2024-01-21 17:42:39 UTC (rev 28637)
@@ -71,12 +71,4 @@
@return The return value of the invocation. If this is not an object, it
will be wrapped in an NSValue. */
@property (nonatomic, unsafe_unretained, readonly) id result;
-/** @brief Wrapper for result
-
- This method has the appropriate decorator on it to silence clang warnings
when the return value from an invocation is retained. It does not ensure
ownership by itself, except in the case of an autoboxed NSValue.
-
- @return Same as FVInvocationOperation::result, but can be used to return
values from retain or copy operations.
- */
-- (id)copyResult;
-
@end
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVInvocationOperation.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVInvocationOperation.m
2024-01-21 17:34:04 UTC (rev 28636)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVInvocationOperation.m
2024-01-21 17:42:39 UTC (rev 28637)
@@ -108,7 +108,7 @@
[self finished];
}
-- (id)copyResult
+- (id)result
{
if ([self isCancelled])
[NSException raise:NSInvalidArgumentException format:@"asked for
return value from cancelled operation"];
@@ -154,9 +154,4 @@
}
-- (id)result
-{
- return [self copyResult];
-}
-
@end
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit