inline bool compare unsigned int it if query size db it size return fa

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
inline bool compare(unsigned int it){
//if(query.size()!=db[it].size())
// return false;
if(db[it][0].size()<query[0].size()||db[it][1].size()<query[1].size()||db[it][2].size()<query[2].size())
return false;
bool a = true;
bool b = true;
bool c = true;
unsigned int iter = 0;
while(a||b||c)
{
if(query[0].size()>iter){
if(query[0][iter]!=db[it][0][iter])
return false;
}
else{
a = false;
}
if(query[1].size()>iter){
if(query[1][iter]!=db[it][1][iter])
return false;
}
else{
b = false;
}
if(query[2].size()>iter){
if(query[2][iter]!=db[it][2][iter])
return false;
}
else{
c = false;
}
iter++;
}
return true;
}