]> git.lyx.org Git - lyx.git/commitdiff
Get rid of superfluous conversions and else statement.
authorEnrico Forestieri <forenr@lyx.org>
Thu, 23 Oct 2008 19:30:51 +0000 (19:30 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Thu, 23 Oct 2008 19:30:51 +0000 (19:30 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27062 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/InsetMathSpecialChar.cpp
src/mathed/MathFactory.cpp

index 6157c7977a023fb949e28119c67e9090a1095b41..828278811065cea5c34bd935164630b9bdb0b0ca 100644 (file)
@@ -32,12 +32,11 @@ InsetMathSpecialChar::InsetMathSpecialChar(docstring name)
        : name_(name), kerning_(0)
 {
        if (name.size() != 1) {
-               if (name == from_ascii("textasciicircum")
-                   || name == from_ascii("mathcircumflex"))
+               if (name == "textasciicircum" || name == "mathcircumflex")
                        char_ = '^';
-               else if (name == from_ascii("textasciitilde"))
+               else if (name == "textasciitilde")
                        char_ = '~';
-               else if (name == from_ascii("textbackslash"))
+               else if (name == "textbackslash")
                        char_ = '\\';
                else
                        LASSERT(false, /**/);
index 8791b719a5478bac4a486ec6fde41825470c8471..50e3fb4cee2622731c2625cc664674611e669ced 100644 (file)
@@ -219,17 +219,15 @@ void initSymbols()
 }
 
 
-bool isSpecialChar(docstring name)
+bool isSpecialChar(docstring const & name)
 {
-       if (name.size() != 1) {
-               string const s = to_ascii(name);
-               return  s == "textasciicircum" || s == "mathcircumflex" ||
-                       s == "textasciitilde"  || s == "textbackslash";
-       } else {
-               char_type const c = name.at(0);
-               return  c == '{' || c == '}' || c == '&' || c == '$' ||
-                       c == '#' || c == '%' || c == '_';
-       }
+       if (name.size() != 1)
+               return  name == "textasciicircum" || name == "mathcircumflex" ||
+                       name == "textasciitilde"  || name == "textbackslash";
+
+       char_type const c = name.at(0);
+       return  c == '{' || c == '}' || c == '&' || c == '$' ||
+               c == '#' || c == '%' || c == '_';
 }