]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/s3select/include/s3select_csv_parser.h
import quincy beta 17.1.0
[ceph.git] / ceph / src / s3select / include / s3select_csv_parser.h
index 5527da913ba5f5261e0b5c431fd1e684ba23aa18..b4a376b04e1d3a63bfac6d186a26ab47920924b8 100644 (file)
@@ -52,12 +52,16 @@ struct csvStateMch_ : public msm::front::state_machine_def<csvStateMch_>
     return *input_cur_location;
   }
 
-  char get_next_char(const char * end_stream)
+
+  char get_next_char(const char* end_stream)
   {
-    if (input_cur_location >= end_stream)
+    input_cur_location++;
+
+    if(input_cur_location >= end_stream)
+    {
       return 0;
+    }
 
-    input_cur_location++;
     return *input_cur_location;
   }
 
@@ -344,6 +348,11 @@ public:
     //TODO for better performance to use template specialization (\n  \ , ")
     do
     {
+      if (p.currentLoc() >= end_stream)
+      {
+        break;
+      }
+
       if (p.get_char() == m_row_delimeter)
       {
         p.process_event(event_eol());
@@ -374,11 +383,8 @@ public:
         return -1;
       }
 
-      if (p.currentLoc() >= end_stream)
-      {
-        break;
-      }
       p.get_next_char(end_stream);
+
     }
     while (p.current_state()[0] != 6);