Skip to content

Commit 5b550ae

Browse files
committed
Use const char* with binary encoded values
When encoding values, there is no need to modify the encoded data when writing it out. So mark the pointers used to reference the encoded data as `const`. While there is nothing happening here that should cause issues, this will help further safeguard developers making changes here and clarify the intent.
1 parent c05d33b commit 5b550ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

numcodecs/vlen.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class VLenUTF8(Codec):
8080
ndarray[object, ndim=1] input_values
8181
object[:] encoded_values
8282
int[:] encoded_lengths
83-
char* encv
83+
const char* encv
8484
bytes b
8585
bytearray out
8686
char* data
@@ -214,7 +214,7 @@ class VLenBytes(Codec):
214214
object[:] values
215215
object[:] normed_values
216216
int[:] lengths
217-
char* encv
217+
const char* encv
218218
object o
219219
bytes b
220220
bytearray out

0 commit comments

Comments
 (0)