aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-05-04 17:09:59 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-05-04 17:09:59 -0700
commit945d069290fcf0ce852120b809ed8aa6cdd1e245 (patch)
treef255c8c8347752e30be003d04654575ae15e1b41
parent7cb140451135d15e4059f047a592d8b48fb8a2be (diff)
downloadbun-945d069290fcf0ce852120b809ed8aa6cdd1e245.tar.gz
bun-945d069290fcf0ce852120b809ed8aa6cdd1e245.tar.zst
bun-945d069290fcf0ce852120b809ed8aa6cdd1e245.zip
Add `UNLIKELY`
-rw-r--r--src/bun.js/bindings/ZigGlobalObject.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bun.js/bindings/ZigGlobalObject.cpp b/src/bun.js/bindings/ZigGlobalObject.cpp
index 2dbccc1f1..dd1c4b08d 100644
--- a/src/bun.js/bindings/ZigGlobalObject.cpp
+++ b/src/bun.js/bindings/ZigGlobalObject.cpp
@@ -1124,7 +1124,7 @@ JSC_DEFINE_HOST_FUNCTION(functionFileURLToPath, (JSC::JSGlobalObject * globalObj
if (!domURL) {
if (arg0.isString()) {
auto url = WTF::URL(arg0.toWTFString(globalObject));
- if (!url.protocolIs("file"_s)) {
+ if (UNLIKELY(!url.protocolIs("file"_s))) {
throwTypeError(globalObject, scope, "Argument must be a file URL"_s);
return JSC::JSValue::encode(JSC::JSValue {});
}
@@ -1136,7 +1136,7 @@ JSC_DEFINE_HOST_FUNCTION(functionFileURLToPath, (JSC::JSGlobalObject * globalObj
}
auto& url = domURL->href();
- if (!url.protocolIs("file"_s)) {
+ if (UNLIKELY(!url.protocolIs("file"_s))) {
throwTypeError(globalObject, scope, "Argument must be a file URL"_s);
return JSC::JSValue::encode(JSC::JSValue {});
}