[gjs: 6/21] module: Remove explicit comparison with nullptr



commit 193f05093369f5c8dca7b7acf2e3a22c55c70e05
Author: Philip Chimento <philip chimento gmail com>
Date:   Fri May 31 22:18:32 2019 -0700

    module: Remove explicit comparison with nullptr
    
    The IWYU tool recommends including <memory> here, only for the reason of
    using std::unique_ptr::operator!=(nullptr_t) but we can just avoid
    including an extra header by using implicit conversion to bool.

 gjs/module.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gjs/module.cpp b/gjs/module.cpp
index 07000dd6..d223c76d 100644
--- a/gjs/module.cpp
+++ b/gjs/module.cpp
@@ -138,7 +138,7 @@ class GjsModule {
             return gjs_throw_gerror_message(cx, error);
 
         GjsAutoChar script = unowned_script;  /* steals ownership */
-        g_assert(script != nullptr);
+        g_assert(script);
 
         GjsAutoChar full_path = g_file_get_parse_name(file);
         return evaluate_import(cx, module, script, script_len, full_path);


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