[gjs] arg-cache: Remove return value check in GenericIn::in



commit 44b0aa9af694c69c427e421a94bfd554d0a220c5
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Fri Oct 23 19:31:32 2020 +0200

    arg-cache: Remove return value check in GenericIn::in
    
    This function won't ever be hit by a return value, as no return value
    may have an in marshaller anyway, so we can just remove the check.

 gi/arg-cache.cpp | 6 ++----
 gi/arg-cache.h   | 1 -
 2 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/gi/arg-cache.cpp b/gi/arg-cache.cpp
index f4d8136e..9fc02613 100644
--- a/gi/arg-cache.cpp
+++ b/gi/arg-cache.cpp
@@ -191,10 +191,8 @@ static bool gjs_marshal_generic_in_in(JSContext* cx, GjsArgumentCache* self,
                                       GjsFunctionCallState*, GIArgument* arg,
                                       JS::HandleValue value) {
     return gjs_value_to_g_argument(cx, value, &self->type_info, self->arg_name,
-                                   self->is_return_value()
-                                       ? GJS_ARGUMENT_RETURN_VALUE
-                                       : GJS_ARGUMENT_ARGUMENT,
-                                   self->transfer, self->flags, arg);
+                                   GJS_ARGUMENT_ARGUMENT, self->transfer,
+                                   self->flags, arg);
 }
 
 GJS_JSAPI_RETURN_CONVENTION
diff --git a/gi/arg-cache.h b/gi/arg-cache.h
index 562dcd3d..98c620b1 100644
--- a/gi/arg-cache.h
+++ b/gi/arg-cache.h
@@ -146,7 +146,6 @@ struct GjsArgumentCache {
         flags =
             GjsArgumentFlags::NONE;  // We don't really care for return values
     }
-    [[nodiscard]] bool is_return_value() { return arg_pos == RETURN_VALUE; }
 
     constexpr bool skip_in() const {
         return (flags & GjsArgumentFlags::SKIP_IN);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]