Skip to content

Commit 1f18130

Browse files
authored
Remove unused JSContext argument (#1072)
Rename from typed_array_get_length to typed_array_length to better align with typed_array_size_log2.
1 parent 34b725d commit 1f18130

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

quickjs.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,7 @@ static JSValue js_typed_array_constructor_ta(JSContext *ctx,
12281228
int classid, uint32_t len);
12291229
static bool is_typed_array(JSClassID class_id);
12301230
static bool typed_array_is_oob(JSObject *p);
1231-
static uint32_t typed_array_get_length(JSContext *ctx, JSObject *p);
1231+
static uint32_t typed_array_length(JSObject *p);
12321232
static JSValue JS_ThrowTypeErrorDetachedArrayBuffer(JSContext *ctx);
12331233
static JSValue JS_ThrowTypeErrorArrayBufferOOB(JSContext *ctx);
12341234
static JSVarRef *get_var_ref(JSContext *ctx, JSStackFrame *sf, int var_idx,
@@ -54118,7 +54118,7 @@ static bool typed_array_is_oob(JSObject *p)
5411854118

5411954119
/* WARNING: 'p' must be a typed array. Works even if the array buffer
5412054120
is detached */
54121-
static uint32_t typed_array_get_length(JSContext *ctx, JSObject *p)
54121+
static uint32_t typed_array_length(JSObject *p)
5412254122
{
5412354123
JSTypedArray *ta = p->u.typed_array;
5412454124
int size_log2 = typed_array_size_log2(p->class_id);
@@ -54896,7 +54896,7 @@ static JSValue js_typed_array_indexOf(JSContext *ctx, JSValueConst this_val,
5489654896
/* "includes" scans all the properties, so "undefined" can match */
5489754897
if (special == special_includes)
5489854898
if (JS_IsUndefined(argv[0]))
54899-
if (k < typed_array_get_length(ctx, p))
54899+
if (k < typed_array_length(p))
5490054900
res = 0;
5490154901
goto done;
5490254902
}
@@ -55337,8 +55337,8 @@ static JSValue js_typed_array_slice(JSContext *ctx, JSValueConst this_val,
5533755337

5533855338
p1 = get_typed_array(ctx, arr);
5533955339
if (p1 != NULL && p->class_id == p1->class_id &&
55340-
typed_array_get_length(ctx, p1) >= count &&
55341-
typed_array_get_length(ctx, p) >= start + count) {
55340+
typed_array_length(p1) >= count &&
55341+
typed_array_length(p) >= start + count) {
5534255342
shift = typed_array_size_log2(p->class_id);
5534355343
memmove(p1->u.array.u.uint8_ptr,
5534455344
p->u.array.u.uint8_ptr + (start << shift),

0 commit comments

Comments
 (0)