]> git.mxchange.org Git - simgear.git/blobdiff - simgear/props/props_io.cxx
Frederic Bouvier:
[simgear.git] / simgear / props / props_io.cxx
index e808e0b63bdb9bf7196151f3a1fcbfab86f455c5..997ac971d3918f3e23c1279a0a6d848fa4947497 100644 (file)
@@ -117,9 +117,9 @@ checkFlag (const char * flag, bool defaultState = true)
 {
   if (flag == 0)
     return defaultState;
-  else if (string(flag) == "y")
+  else if (!strcmp(flag, "y"))
     return true;
-  else if (string(flag) == "n")
+  else if (!strcmp(flag, "n"))
     return false;
   else {
     string message = "Unrecognized flag value '";
@@ -133,11 +133,10 @@ checkFlag (const char * flag, bool defaultState = true)
 void
 PropsVisitor::startElement (const char * name, const XMLAttributes &atts)
 {
-  State &st = state();
   const char * attval;
 
   if (_level == 0) {
-    if (string(name) != (string)"PropertyList") {
+    if (strcmp(name, "PropertyList")) {
       string message = "Root element name is ";
       message += name;
       message += "; expected PropertyList";
@@ -160,6 +159,7 @@ PropsVisitor::startElement (const char * name, const XMLAttributes &atts)
   }
 
   else {
+    State &st = state();
                                // Get the index.
     attval = atts.getValue("n");
     int index = 0;