Skip to content

Commit e283938

Browse files
committed
Small refactor in CoordSeq::new_from_buffer
1 parent 133ff99 commit e283938

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/coord_seq.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,7 @@ impl CoordSeq {
164164
has_z: bool,
165165
has_m: bool,
166166
) -> GResult<CoordSeq> {
167-
let mut dims: u32 = 2;
168-
if has_z {
169-
dims += 1;
170-
}
171-
if has_m {
172-
dims += 1;
173-
}
167+
let dims = 2 + u32::from(has_z) + u32::from(has_m);
174168

175169
assert_eq!(data.len(), size * dims as usize, "Incorrect buffer length");
176170

0 commit comments

Comments
 (0)