[gjs/wip/ptomato/mozjs52: 4/37] jsapi-util-string: Remove useless length calculation



commit c323997904b357288826cc76ea716b9324959e1c
Author: Philip Chimento <philip chimento gmail com>
Date:   Sat Jun 24 23:42:44 2017 -0700

    jsapi-util-string: Remove useless length calculation
    
    This was left over from using JS_EncodeStringToBuffer() in past code. It
    is not used now, so it's unnecessary to calculate it.

 gjs/jsapi-util-string.cpp |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)
---
diff --git a/gjs/jsapi-util-string.cpp b/gjs/jsapi-util-string.cpp
index e01d595..1608527 100644
--- a/gjs/jsapi-util-string.cpp
+++ b/gjs/jsapi-util-string.cpp
@@ -34,8 +34,6 @@ gjs_string_to_utf8 (JSContext      *context,
                     const JS::Value value,
                     GjsAutoJSChar  *utf8_string_p)
 {
-    gsize len;
-
     JS_BeginRequest(context);
 
     if (!value.isString()) {
@@ -46,13 +44,6 @@ gjs_string_to_utf8 (JSContext      *context,
     }
 
     JS::RootedString str(context, value.toString());
-
-    len = JS_GetStringEncodingLength(context, str);
-    if (len == (gsize)(-1)) {
-        JS_EndRequest(context);
-        return false;
-    }
-
     utf8_string_p->reset(context, JS_EncodeStringToUTF8(context, str));
 
     JS_EndRequest(context);


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