Skip to content

Commit be061dd

Browse files
author
mtolman
committed
removed some magic numbers
1 parent 5209b61 commit be061dd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/zero_allocs/slice.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ pub const FieldParser = struct {
209209

210210
/// Gets the current start position
211211
pub fn startPos(self: *const FieldParser) u64 {
212-
const base = self._state.start_chunk * 64 + self._state.start_chunk_pos;
212+
const base = self._state.start_chunk * chunk_size + self._state.start_chunk_pos;
213213
if (self._state.skip) {
214214
return base + 1;
215215
}
@@ -223,7 +223,7 @@ pub const FieldParser = struct {
223223

224224
/// Returns whether has next chunk
225225
fn hasNextChunk(self: *const FieldParser) bool {
226-
return self._state.next_chunk * 64 < self._text.len;
226+
return self._state.next_chunk * chunk_size < self._text.len;
227227
}
228228

229229
/// reates match bit string
@@ -270,7 +270,7 @@ pub const FieldParser = struct {
270270
self._state.next_chunk += 1;
271271
}
272272

273-
const next_chunk_start = self._state.next_chunk * 64;
273+
const next_chunk_start = self._state.next_chunk * chunk_size;
274274
assert(next_chunk_start < self._text.len);
275275

276276
const sub_text = self._text[next_chunk_start..];
@@ -372,7 +372,7 @@ pub const FieldParser = struct {
372372
}
373373

374374
const chunk_end = @ctz(self._state.field_separators);
375-
const t_end = (self._state.end_chunk * 64) + chunk_end;
375+
const t_end = (self._state.end_chunk * chunk_size) + chunk_end;
376376
const end_pos = @min(self._text.len - 1, t_end);
377377
assert(self._state.end_chunk >= self._state.start_chunk);
378378

0 commit comments

Comments
 (0)