Skip to content

Commit

Permalink
added line spacings
Browse files Browse the repository at this point in the history
  • Loading branch information
philippedistributive committed Jul 30, 2024
1 parent 80eee20 commit 88973b7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/PyBytesProxyHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ static bool array_valueOf(JSContext *cx, unsigned argc, JS::Value *vp) {
bool isSharedMemory;
JS::AutoCheckCannotGC autoNoGC(cx);
uint8_t *data = JS::GetArrayBufferData(rootedArrayBuffer, &isSharedMemory, autoNoGC);

size_t numberOfDigits = 0;
for (size_t i = 0; i < byteLength; i++) {
numberOfDigits += data[i] < 10 ? 1 : data[i] < 100 ? 2 : 3;
Expand All @@ -44,6 +45,7 @@ static bool array_valueOf(JSContext *cx, unsigned argc, JS::Value *vp) {
size_t charIndex = 0;
sprintf((char*)&buffer[charIndex], "%d", data[0]);
charIndex += data[0] < 10 ? 1 : data[0] < 100 ? 2 : 3;

for (size_t dataIndex = 1; dataIndex < byteLength; dataIndex++) {
buffer[charIndex] = ',';
charIndex++;
Expand Down

0 comments on commit 88973b7

Please sign in to comment.