@@ -623,23 +623,6 @@ - (NSMutableArray *)diff_lineModeFromOldString:(NSString *)text1
623623 return diffs;
624624}
625625
626- /* *
627- * Split a text into a list of strings. Reduce the texts to a string of
628- * hashes where each Unicode character represents one line.
629- * @param text NSString to encode.
630- * @param lineArray NSMutableArray of unique strings.
631- * @param lineHash Map of strings to indices.
632- * @return Encoded string.
633- */
634- - (NSString *)diff_linesToCharsMungeOfText : (NSString *)text
635- lineArray : (NSMutableArray *)lineArray
636- lineHash : (NSMutableDictionary *)lineHash ;
637- {
638- return [((NSString *)diff_linesToCharsMungeCFStringCreate ((CFStringRef)text,
639- (CFMutableArrayRef)lineArray,
640- (CFMutableDictionaryRef)lineHash)) autorelease ];
641- }
642-
643626/* *
644627 * Find the 'middle snake' of a diff, split the problem in two
645628 * and return the recursively constructed diff.
@@ -859,12 +842,15 @@ - (NSArray *)diff_linesToCharsForFirstString:(NSString *)text1
859842 // So we'll insert a junk entry to avoid generating a nil character.
860843 [lineArray addObject: @" " ];
861844
845+ // Allocate 2/3rds of the space for text1, the rest for text2.
862846 NSString *chars1 = (NSString *)diff_linesToCharsMungeCFStringCreate ((CFStringRef)text1,
863847 (CFMutableArrayRef)lineArray,
864- (CFMutableDictionaryRef)lineHash);
848+ (CFMutableDictionaryRef)lineHash,
849+ 40000 );
865850 NSString *chars2 = (NSString *)diff_linesToCharsMungeCFStringCreate ((CFStringRef)text2,
866851 (CFMutableArrayRef)lineArray,
867- (CFMutableDictionaryRef)lineHash);
852+ (CFMutableDictionaryRef)lineHash,
853+ 65535 );
868854
869855 NSArray *result = [NSArray arrayWithObjects: chars1, chars2, lineArray, nil ];
870856
0 commit comments