code: func (itr *resultsItr) updateRangeQueryInfo(queryResult statedb.QueryResult) {
  	if itr.rwSetBuilder == nil {
  		return
  	}
  
  	if queryResult == nil {
  		// caller scanned till the iterator got exhausted.
  		// So, set the endKey to the actual endKey supplied in the query
  		itr.rangeQueryInfo.ItrExhausted = true
  		itr.rangeQueryInfo.EndKey = itr.endKey
  		return
  	}
  	versionedKV := queryResult.(*statedb.VersionedKV)
  	itr.rangeQueryResultsHelper.AddResult(rwsetutil.NewKVRead(versionedKV.Key, versionedKV.Version))
  	// Set the end key to the latest key retrieved by the caller.
  	// Because, the caller may actually not invoke the Next() function again
  	itr.rangeQueryInfo.EndKey = versionedKV.Key
  }
docs: // updateRangeQueryInfo updates two attributes of the rangeQueryInfo
  // 1) The EndKey - set to either a) latest key that is to be returned to the caller (if the iterator is not exhausted)
  //                                  because, we do not know if the caller is again going to invoke Next() or not.
  //                            or b) the last key that was supplied in the original query (if the iterator is exhausted)
  // 2) The ItrExhausted - set to true if the iterator is going to return nil as a result of the Next() call