From ef1f8d10b7fa6e3d48f5df507a28571b86b42559 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Thu, 2 Dec 2021 17:02:00 +0100 Subject: [PATCH] [ecmascript] check_in_map_timer -> found_in_map_timer --- src/ecmascript/ecmascript.c | 6 +++--- src/ecmascript/quickjs/window.c | 2 +- src/ecmascript/spidermonkey/window.c | 2 +- src/ecmascript/timer.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ecmascript/ecmascript.c b/src/ecmascript/ecmascript.c index 2a5a2e99..f2babf70 100644 --- a/src/ecmascript/ecmascript.c +++ b/src/ecmascript/ecmascript.c @@ -594,7 +594,7 @@ ecmascript_set_timeout(struct ecmascript_interpreter *interpreter, char *code, i init_string(&interpreter->code); add_to_string(&interpreter->code, code); mem_free(code); - if (check_in_map_timer(interpreter->vs->doc_view->document->timeout)) { + if (found_in_map_timer(interpreter->vs->doc_view->document->timeout)) { kill_timer(&interpreter->vs->doc_view->document->timeout); } install_timer(&interpreter->vs->doc_view->document->timeout, timeout, ecmascript_timeout_handler, interpreter); @@ -609,7 +609,7 @@ ecmascript_set_timeout2(struct ecmascript_interpreter *interpreter, JS::HandleVa assert(interpreter && interpreter->vs->doc_view->document); done_string(&interpreter->code); init_string(&interpreter->code); - if (check_in_map_timer(interpreter->vs->doc_view->document->timeout)) { + if (found_in_map_timer(interpreter->vs->doc_view->document->timeout)) { kill_timer(&interpreter->vs->doc_view->document->timeout); } JS::RootedValue fun((JSContext *)interpreter->backend_data, f); @@ -627,7 +627,7 @@ ecmascript_set_timeout2q(struct ecmascript_interpreter *interpreter, JSValueCons assert(interpreter && interpreter->vs->doc_view->document); done_string(&interpreter->code); init_string(&interpreter->code); - if (check_in_map_timer(interpreter->vs->doc_view->document->timeout)) { + if (found_in_map_timer(interpreter->vs->doc_view->document->timeout)) { kill_timer(&interpreter->vs->doc_view->document->timeout); } interpreter->fun = fun; diff --git a/src/ecmascript/quickjs/window.c b/src/ecmascript/quickjs/window.c index 117b0c9b..6095a5c8 100644 --- a/src/ecmascript/quickjs/window.c +++ b/src/ecmascript/quickjs/window.c @@ -240,7 +240,7 @@ js_window_clearTimeout(JSContext *ctx, JSValueConst this_val, int argc, JSValueC timer_id_T id = reinterpret_cast(number); - if (check_in_map_timer(id)) { + if (found_in_map_timer(id)) { kill_timer(&id); } diff --git a/src/ecmascript/spidermonkey/window.c b/src/ecmascript/spidermonkey/window.c index ee7f63b7..5290c200 100644 --- a/src/ecmascript/spidermonkey/window.c +++ b/src/ecmascript/spidermonkey/window.c @@ -483,7 +483,7 @@ window_clearTimeout(JSContext *ctx, unsigned int argc, JS::Value *rval) int64_t number = JS::ToBigInt64(bi); timer_id_T id = reinterpret_cast(number); - if (check_in_map_timer(id)) { + if (found_in_map_timer(id)) { kill_timer(&id); } return true; diff --git a/src/ecmascript/timer.h b/src/ecmascript/timer.h index 69495cd9..df133015 100644 --- a/src/ecmascript/timer.h +++ b/src/ecmascript/timer.h @@ -20,7 +20,7 @@ del_from_map_timer(struct timer *timer) } inline bool -check_in_map_timer(struct timer *timer) +found_in_map_timer(struct timer *timer) { return map_timer.find(timer) != map_timer.end(); }