BTree.st
changeset 3118 2079e721da7a
parent 3041 563f38b0db89
child 4098 7da8ffc32c43
equal deleted inserted replaced
3117:21453eeba760 3118:2079e721da7a
   837 			abbreviations at: (j-1 * self abbreviationSize) + i put: c]].
   837 			abbreviations at: (j-1 * self abbreviationSize) + i put: c]].
   838 	^ abbreviations
   838 	^ abbreviations
   839 !
   839 !
   840 
   840 
   841 extractPrefixFrom: readStreams
   841 extractPrefixFrom: readStreams
   842 	| prefixStream nextChars |
   842         | prefixStream nextChars |
   843 	prefixStream _ String new writeStream.
   843         prefixStream _ String new writeStream.
   844 	
   844         
   845 	[readStreams anySatisfy: [:ea | ea atEnd]] whileFalse:
   845         [readStreams anySatisfy: [:ea | ea atEnd]] whileFalse:
   846 		[nextChars _ readStreams collect: [:ea | ea next].
   846                 [nextChars _ readStreams collect: [:ea | ea next].
   847 		(nextChars allSatisfy: [:ea | ea = nextChars first])
   847                 (nextChars conform: [:ea | ea = nextChars first])
   848 				ifTrue: [prefixStream nextPut: nextChars first]
   848                                 ifTrue: [prefixStream nextPut: nextChars first]
   849 				ifFalse: [readStreams do: [:ea | ea skip: -1]. ^ prefixStream contents]].
   849                                 ifFalse: [readStreams do: [:ea | ea skip: -1]. ^ prefixStream contents]].
   850 	^ prefixStream contents
   850         ^ prefixStream contents
   851 !
   851 !
   852 
   852 
   853 findIndexForKey: aString
   853 findIndexForKey: aString
   854         | stream str diff |
   854         | stream str diff |
   855         prefix = self nilPrefix ifTrue: [self rebuildAbbreviations].
   855         prefix = self nilPrefix ifTrue: [self rebuildAbbreviations].
   892 ! !
   892 ! !
   893 
   893 
   894 !BTree class methodsFor:'documentation'!
   894 !BTree class methodsFor:'documentation'!
   895 
   895 
   896 version_CVS
   896 version_CVS
   897     ^ '$Header: /cvs/stx/stx/libbasic2/BTree.st,v 1.14 2013-07-08 13:05:21 cg Exp $'
   897     ^ '$Header: /cvs/stx/stx/libbasic2/BTree.st,v 1.15 2013-09-05 23:15:11 cg Exp $'
   898 ! !
   898 ! !
   899 
   899