Reviewed by Beth Dakin.
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Jan 2008 01:22:25 +0000 (01:22 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Jan 2008 01:22:25 +0000 (01:22 +0000)
        Remove unneeded variable.

        * kjs/string_object.cpp:
        (KJS::StringProtoFuncSubstr::callAsFunction):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29503 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/kjs/string_object.cpp

index 4043cb1..e7ec485 100644 (file)
@@ -1,3 +1,12 @@
+2008-01-15  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Beth Dakin.
+
+        Remove unneeded variable.
+
+        * kjs/string_object.cpp:
+        (KJS::StringProtoFuncSubstr::callAsFunction):
+
 2008-01-14  Steve Falkenburg  <sfalken@apple.com>
 
         Use shared vsprops for most vcproj properties.
index 3689a9f..182c9b8 100644 (file)
@@ -732,8 +732,6 @@ JSValue* StringProtoFuncSubstr::callAsFunction(ExecState* exec, JSObject* thisOb
     JSValue* a0 = args[0];
     JSValue* a1 = args[1];
 
-    double d = 0.0;
-
     double start = a0->toInteger(exec);
     double length = a1->isUndefined() ? len : a1->toInteger(exec);
     if (start >= len)
@@ -745,8 +743,8 @@ JSValue* StringProtoFuncSubstr::callAsFunction(ExecState* exec, JSObject* thisOb
       if (start < 0)
         start = 0;
     }
-    if (length > len - d)
-      length = len - d;
+    if (length > len)
+      length = len;
     return jsString(s.substr(static_cast<int>(start), static_cast<int>(length)));
 }