File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ class OpsToSqlQueryEmitter
9292{
9393public:
9494 OpsToSqlQueryEmitter (uint64_t const * ops, std::string& stmt) noexcept :
95- ops (ops), ogStmt (stmt) {}
95+ ops (ops), offset(stmt.size()), stmt (stmt) {}
9696
9797 int Parse (int opsSize) noexcept
9898 {
@@ -103,16 +103,14 @@ class OpsToSqlQueryEmitter
103103 Emit (" ((datas.type&0x4000)==0)AND" );
104104 if (!allowAliases)
105105 Emit (" (datas.alias!=0)AND" );
106- Emit (ogStmt);
107- std::reverse (stmt.begin (), stmt.end ());
108- ogStmt.swap (stmt);
106+ std::reverse (std::next (stmt.begin (), offset), stmt.end ());
109107 return r;
110108 }
111109
112110private:
113111 uint64_t const * ops;
114- std::string& ogStmt ;
115- std::string stmt;
112+ size_t offset ;
113+ std::string& stmt;
116114 bool allowAliases = false ;
117115 bool allowTokens = false ;
118116
You can’t perform that action at this time.
0 commit comments