Shlomi Fish avatar Shlomi Fish committed 600abbf

Small optimisation to the cmd_line.c.

git-svn-id: file:///home/shlomif/Backup/svn-dumps/google-code/svnsync-repos/fc-solve/trunk@1166 e7e8a897-7ba4-4ee7-b36f-f4c66519b19a

Comments (0)

Files changed (2)

fc-solve/source/cmd_line.c

 {
 if (!strncmp(p, "ard-thread", 10)) {
 p += 10;
-opt = FCS_OPT_NEXT_SOFT_THREAD;
+opt = FCS_OPT_NEXT_HARD_THREAD;
 
 }
 }
 {
 if (!strncmp(p, "t", 1)) {
 p += 1;
-opt = FCS_OPT_NEXT_SOFT_THREAD;
+opt = FCS_OPT_NEXT_HARD_THREAD;
 
 }
 }
         }
         break;
 
-        case FCS_OPT_NEXT_SOFT_THREAD: /* STRINGS=-nst|--next-soft-thread|-nht|--next-hard-thread; */
+        case FCS_OPT_NEXT_SOFT_THREAD: /* STRINGS=-nst|--next-soft-thread; */
+        case FCS_OPT_NEXT_HARD_THREAD: /* STRINGS=-nht|--next-hard-thread; */
         {
             int ret;
-            int is_st = ((!strcmp((*arg), "-nst")) || (!strcmp((*arg), "--next-soft-thread")));
 
             ret =
-                is_st ?
-                    freecell_solver_user_next_soft_thread(instance) :
-                    freecell_solver_user_next_hard_thread(instance)
+                (opt == FCS_OPT_NEXT_SOFT_THREAD)
+                    ? freecell_solver_user_next_soft_thread(instance)
+                    : freecell_solver_user_next_hard_thread(instance)
                     ;
 
             if (ret)

fc-solve/source/cmd_line_enum.h

     FCS_OPT_SEED,
     FCS_OPT_MAX_STORED_STATES,
     FCS_OPT_NEXT_SOFT_THREAD,
+    FCS_OPT_NEXT_HARD_THREAD,
     FCS_OPT_SOFT_THREAD_STEP,
     FCS_OPT_REPARENT_STATES,
     FCS_OPT_CALC_REAL_DEPTH,
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.