summaryrefslogtreecommitdiff
path: root/gi/object.cpp
diff options
context:
space:
mode:
authorPhilip Chimento <philip.chimento@gmail.com>2021-09-28 23:24:01 -0700
committerPhilip Chimento <philip.chimento@gmail.com>2021-09-30 22:55:54 -0700
commit5aa16cecd74a3dcf01ab575945bbf0aefd2ae53a (patch)
tree0dedb7774de20f1f8fb290241d05ddf8c9d41981 /gi/object.cpp
parent132326a95a2c30ec59e7a7e87e6bc7b467238c1f (diff)
downloadgjs-5aa16cecd74a3dcf01ab575945bbf0aefd2ae53a.tar.gz
object: Combine consecutive if-blocks
There were two if-blocks with the same condition, and the condition was not modified in the body of the first block. When combining them, the code looks slightly odd though, so clarify why this is correct with a comment.
Diffstat (limited to 'gi/object.cpp')
-rw-r--r--gi/object.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/gi/object.cpp b/gi/object.cpp
index 602a2875..3b1a1bd0 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -2793,9 +2793,8 @@ bool ObjectPrototype::hook_up_vfunc_impl(JSContext* cx,
}
}
}
- }
- if (!vfunc) {
+ // Fall back to less helpful error message
gjs_throw(cx, "Could not find definition of virtual function %s",
name.get());
return false;