comparison src/org/tmatesoft/hg/internal/KeywordFilter.java @ 121:b1d6208fb517

Conditionally apply filters to file content
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 04 Feb 2011 03:37:09 +0100
parents ed2b4adac51c
children 44b97930570c
comparison
equal deleted inserted replaced
120:b19f0ac5ee62 121:b1d6208fb517
113 // bytes). To prevent this, either shall copy bytes [keywordStart..buffer.limit()) to local buffer and use it on the next invocation, 113 // bytes). To prevent this, either shall copy bytes [keywordStart..buffer.limit()) to local buffer and use it on the next invocation,
114 // or add lookup of the keywords right after first '$' is found (do not wait for closing '$'). For now, large enough src buffer would be sufficient 114 // or add lookup of the keywords right after first '$' is found (do not wait for closing '$'). For now, large enough src buffer would be sufficient
115 // not to run into such situation 115 // not to run into such situation
116 throw new IllegalStateException("Try src buffer of a greater size"); 116 throw new IllegalStateException("Try src buffer of a greater size");
117 } 117 }
118 rv = ByteBuffer.allocate(keywordStart - x); 118 rv = ByteBuffer.allocate(keywordStart - copyFrom);
119 } 119 }
120 // copy all from source till latest possible kw start 120 // copy all from source till latest possible kw start
121 copySlice(src, copyFrom, keywordStart, rv); 121 copySlice(src, copyFrom, keywordStart, rv);
122 rv.flip(); 122 rv.flip();
123 // and tell caller we've consumed only to the potential kw start 123 // and tell caller we've consumed only to the potential kw start