[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdelibs/kjs
From:       Harri Porten <porten () kde ! org>
Date:       2005-04-16 20:04:58
Message-ID: 20050416200458.95B0D3CA () office ! kde ! org
[Download RAW message or body]

CVS commit by porten: 

save some cpu cycles on variable declarations


  M +2 -0      ChangeLog   1.58
  M +8 -5      nodes.cpp   1.171


--- kdelibs/kjs/nodes.cpp  #1.170:1.171
@@ -1244,5 +1244,5 @@ Value AppendStringNode::evaluate(ExecSta
 {
   UString s = term->toString(exec);
-  KJS_CHECKEXCEPTIONVALUE;
+  KJS_CHECKEXCEPTIONVALUE
 
   return String(s + str);
@@ -1466,5 +1466,5 @@ Value BinaryLogicalNode::evaluate(ExecSt
 {
   Value v1 = expr1->evaluate(exec);
-  KJS_CHECKEXCEPTIONVALUE;
+  KJS_CHECKEXCEPTIONVALUE
   bool b1 = v1.toBoolean(exec);
   if ((!b1 && oper == OpAnd) || (b1 && oper == OpOr))
@@ -1781,5 +1781,8 @@ Value VarDeclNode::evaluate(ExecState *e
   variable.put(exec, ident, val, flags);
 
-  return String(ident.ustring());
+  // the spec wants us to return the name of the identifier here
+  // but we'll save the construction and copying as the return
+  // value isn't used by the caller
+  return Value();
 }
 
@@ -1828,5 +1831,5 @@ Value VarDeclListNode::evaluate(ExecStat
 {
   for (const VarDeclListNode *n = this; n; n = n->list) {
-    n->var->evaluate(exec);
+    (void)n->var->evaluate(exec);
     KJS_CHECKEXCEPTIONVALUE
   }
@@ -2247,5 +2250,5 @@ Completion ForInNode::execute(ExecState 
 
   if ( varDecl ) {
-    varDecl->evaluate(exec);
+    (void)varDecl->evaluate(exec);
     KJS_CHECKEXCEPTION
   }

--- kdelibs/kjs/ChangeLog  #1.57:1.58
@@ -1,4 +1,6 @@
 2005-04-16  Harri Porten  <porten@kde.org>
 
+        * nodes.cpp: save some cpu cycles on variable declarations 
+
         * error_object.cpp: made prototype read-only (JSC patch) 
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic