You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by bh...@apache.org on 2019/06/26 14:44:31 UTC

[arrow] 01/01: Use stride in DataBufferBuilder.set

This is an automated email from the ASF dual-hosted git repository.

bhulette pushed a commit to branch js-data-buffer-builder-stride
in repository https://gitbox.apache.org/repos/asf/arrow.git

commit 2e4ce7af02e4a906c024d1f2cbd213bebd59a527
Author: Brian Hulette <hu...@gmail.com>
AuthorDate: Mon Jun 24 19:47:01 2019 -0700

    Use stride in DataBufferBuilder.set
---
 js/src/builder/buffer.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/js/src/builder/buffer.ts b/js/src/builder/buffer.ts
index b9f7aa4..41f5c70 100644
--- a/js/src/builder/buffer.ts
+++ b/js/src/builder/buffer.ts
@@ -105,7 +105,7 @@ export class DataBufferBuilder<T extends TypedArray> extends BufferBuilder<T, nu
     public get(index: number) { return this.buffer[index]; }
     public set(index: number, value: number) {
         this.reserve(index - this.length + 1);
-        this.buffer[index] = value;
+        this.buffer[index * this.stride] = value;
         return this;
     }
 }