MCPcopy Create free account
hub / github.com/creatale/node-dv / findstr

Function findstr

deps/opencv/modules/core/src/algorithm.cpp:101–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99
100
101template<typename _ValueTp> inline const _ValueTp* findstr(const sorted_vector<string, _ValueTp>& vec,
102 const char* key)
103{
104 if( !key )
105 return 0;
106
107 size_t a = 0, b = vec.vec.size();
108 while( b > a )
109 {
110 size_t c = (a + b)/2;
111 if( strcmp(vec.vec[c].first.c_str(), key) < 0 )
112 a = c+1;
113 else
114 b = c;
115 }
116
117 if( ( a < vec.vec.size() ) && ( strcmp(vec.vec[a].first.c_str(), key) == 0 ))
118 return &vec.vec[a].second;
119 return 0;
120}
121
122
123Param::Param()

Callers 4

setMethod · 0.85
getMethod · 0.85
paramTypeMethod · 0.85
paramHelpMethod · 0.85

Calls 2

sizeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected