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

Method add

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

Source from the content-addressed store, hash-verified

56 const _ValueTp& operator [](size_t idx) const { return vec[idx]; }
57
58 void add(const _KeyTp& k, const _ValueTp& val)
59 {
60 pair<_KeyTp, _ValueTp> p(k, val);
61 vec.push_back(p);
62 size_t i = vec.size()-1;
63 for( ; i > 0 && vec[i].first < vec[i-1].first; i-- )
64 std::swap(vec[i-1], vec[i]);
65 CV_Assert( i == 0 || vec[i].first != vec[i-1].first );
66 }
67
68 bool find(const _KeyTp& key, _ValueTp& value) const
69 {

Callers 2

AlgorithmInfoMethod · 0.45
addParam_Method · 0.45

Calls 3

swapFunction · 0.70
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected