Skip to content

Clean up indexing of ByteBufferView

Lukasa requested to merge lukasa/RediStack:cb-bbv-indexing-master into master

Motivation:

ByteBufferView is not zero indexed, but parseSimpleString assumes it is.

Modifications:

  • Correctly compute on the distance between two indices.
  • New, somewhat contrived, test case.

Result:

No functional change: because RediStack assumes the remote peer will always correctly terminate with /r/n, there is no point at which this code could misbehave in the current implementation. However, with small changes it is possible to trigger it, as the new test demonstrates.

Merge request reports