This is an automated email from the ASF dual-hosted git repository.

haonan pushed a commit to branch rel/0.13
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/rel/0.13 by this push:
     new 855cf8e7c5 IOTDB-3901 C++ client method of insertRecordsOfOneDevice 
sorting optimization (#6733)
855cf8e7c5 is described below

commit 855cf8e7c5e7da87f33437e3390f4e5ffaa328af
Author: liruizhi19 <[email protected]>
AuthorDate: Thu Jul 21 08:56:53 2022 +0800

    IOTDB-3901 C++ client method of insertRecordsOfOneDevice sorting 
optimization (#6733)
---
 client-cpp/src/main/Session.cpp | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/client-cpp/src/main/Session.cpp b/client-cpp/src/main/Session.cpp
index e27fe755c3..249e70ef65 100644
--- a/client-cpp/src/main/Session.cpp
+++ b/client-cpp/src/main/Session.cpp
@@ -906,11 +906,7 @@ void Session::insertRecordsOfOneDevice(const string 
&deviceId,
                                        vector<vector<char *>> &valuesList,
                                        bool sorted) {
 
-    if (sorted) {
-        if (!checkSorted(times)) {
-            throw BatchExecutionException("Times in InsertOneDeviceRecords are 
not in ascending order");
-        }
-    } else {
+    if (!checkSorted(times)) {
         int *index = new int[times.size()];
         for (size_t i = 0; i < times.size(); i++) {
             index[i] = i;
@@ -962,11 +958,7 @@ void Session::insertAlignedRecordsOfOneDevice(const string 
&deviceId,
                                               vector<vector<char *>> 
&valuesList,
                                               bool sorted) {
 
-    if (sorted) {
-        if (!checkSorted(times)) {
-            throw BatchExecutionException("Times in InsertOneDeviceRecords are 
not in ascending order");
-        }
-    } else {
+    if (!checkSorted(times)) {
         int *index = new int[times.size()];
         for (size_t i = 0; i < times.size(); i++) {
             index[i] = i;

Reply via email to