Module: Xapian
- Defined in:
- lib/xapian.rb
Defined Under Namespace
Classes: Database, Document, ESet, Enquire, ExpandTerm, MSet, Match, Posting, Query, Term, Value, ValueCountMatchSpy
Class Method Summary collapse
-
._safelyIterate(dangerousStart, dangerousEnd) ⇒ Object
iterate over two dangerous iterators (i.e. those that can cause segfaults if used improperly.) Return the results as an Array.
Class Method Details
._safelyIterate(dangerousStart, dangerousEnd) ⇒ Object
iterate over two dangerous iterators (i.e. those that can cause segfaults if used improperly.) Return the results as an Array. Users should never need to use this method.
Takes a block that returns some appropriate Ruby object to wrap the underlying Iterator
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/xapian.rb', line 52 def _safelyIterate(dangerousStart, dangerousEnd) #:nodoc: retval = Array.new item = dangerousStart lastTerm = dangerousEnd return retval if dangerousStart.equals(dangerousEnd) begin retval.push(yield(item)) item.next() end while not item.equals(lastTerm) # must use primitive C++ comparator return retval end |