Mercurial Hosting > luan
diff src/org/eclipse/jetty/io/BufferCache.java @ 837:3ff59e08a1b7
fix last commit
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 16 Sep 2016 12:56:08 -0600 |
parents | e161dca40760 |
children | 74b9daf2826c |
line wrap: on
line diff
--- a/src/org/eclipse/jetty/io/BufferCache.java Fri Sep 16 12:35:17 2016 -0600 +++ b/src/org/eclipse/jetty/io/BufferCache.java Fri Sep 16 12:56:08 2016 -0600 @@ -106,10 +106,7 @@ int n = Math.min( key.length(), Math.min( floorKey.length(), ceilingKey.length() ) ); int i = 0; while( ++i <= n && key.regionMatches(0,floorKey,0,i) && key.regionMatches(0,ceilingKey,0,i) ); - i--; - if( i==0 ) - return null; - return i==0 ? null : key.regionMatches(0,floorKey,0,i) ? (CachedBuffer)floor.getValue() : (CachedBuffer)ceiling.getValue(); + return key.regionMatches(0,floorKey,0,i) ? (CachedBuffer)floor.getValue() : key.regionMatches(0,ceilingKey,0,i) || i > 1 ? (CachedBuffer)ceiling.getValue() : null; } /* Entry entry = _stringMap.getBestEntry(value, offset, maxLength);