Mercurial Hosting > luan
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 836:e161dca40760 | 837:3ff59e08a1b7 |
|---|---|
| 104 return key.charAt(0) == floorKey.charAt(0) ? (CachedBuffer)floor.getValue() : null; | 104 return key.charAt(0) == floorKey.charAt(0) ? (CachedBuffer)floor.getValue() : null; |
| 105 String ceilingKey = (String)ceiling.getKey(); | 105 String ceilingKey = (String)ceiling.getKey(); |
| 106 int n = Math.min( key.length(), Math.min( floorKey.length(), ceilingKey.length() ) ); | 106 int n = Math.min( key.length(), Math.min( floorKey.length(), ceilingKey.length() ) ); |
| 107 int i = 0; | 107 int i = 0; |
| 108 while( ++i <= n && key.regionMatches(0,floorKey,0,i) && key.regionMatches(0,ceilingKey,0,i) ); | 108 while( ++i <= n && key.regionMatches(0,floorKey,0,i) && key.regionMatches(0,ceilingKey,0,i) ); |
| 109 i--; | 109 return key.regionMatches(0,floorKey,0,i) ? (CachedBuffer)floor.getValue() : key.regionMatches(0,ceilingKey,0,i) || i > 1 ? (CachedBuffer)ceiling.getValue() : null; |
| 110 if( i==0 ) | |
| 111 return null; | |
| 112 return i==0 ? null : key.regionMatches(0,floorKey,0,i) ? (CachedBuffer)floor.getValue() : (CachedBuffer)ceiling.getValue(); | |
| 113 } | 110 } |
| 114 /* | 111 /* |
| 115 Entry entry = _stringMap.getBestEntry(value, offset, maxLength); | 112 Entry entry = _stringMap.getBestEntry(value, offset, maxLength); |
| 116 if (entry!=null) | 113 if (entry!=null) |
| 117 return (CachedBuffer)entry.getValue(); | 114 return (CachedBuffer)entry.getValue(); |
