[Sie-announce] SIEコード [1583] chsetの最適化

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 1月 15日 (金) 22:00:46 JST


Revision: 1583
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=1583
Author:   dhrname
Date:     2010-01-15 22:00:46 +0900 (Fri, 15 Jan 2010)

Log Message:
-----------
chsetの最適化

Modified Paths:
--------------
    branches/05x/058/sie.js

Modified: branches/05x/058/sie.js
===================================================================
--- branches/05x/058/sie.js	2010-01-15 12:56:43 UTC (rev 1582)
+++ branches/05x/058/sie.js	2010-01-15 13:00:46 UTC (rev 1583)
@@ -272,6 +272,9 @@
     "polyline" : STPolyline,
     "polygon" : STPolygon,
     "line" : STLine
+  },
+  isOne = {
+    1 : 1
   };
 SVGtoVML.prototype.chset = function _s_chset( /*element*/ ele, /*Matrix*/ matrix, /*float*/w, /*float*/h){
   var s = null, _isGroup = isGroup, _isShape = isShape, _STElement = STElement, _isText = isText;
@@ -280,13 +283,13 @@
   var te = ele.firstChild;
   if (!!te) {
   do {
-    if (name.indexOf(te.nodeName) === -1) { //タグ名が一致しないのであれば
+    if (isOne[name.indexOf(te.nodeName)]) { //タグ名が一致しないのであれば
       var ns = te.nextSibling; //次のノードをnsに収納
       var er = ele.removeChild(te);
       er = null;
       te = ns;
     } else {
-      if (te.nodeType === 1) { //要素ならば
+      if (isOne[te.nodeType]) { //要素ならば
         var ten = te.nodeName;
         if (_isGroup[ten]) {
           s = new STGroupElement(te, matrix, w, h);




Sie-announce メーリングリストの案内
Back to archive index