MCPcopy Create free account
hub / github.com/ad-si/LuaCAD / newValue

Method newValue

OpenCSG/src/channelManager.cpp:68–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66 public:
67 MaximumMemorizer() : mMax(0), mSecondMax(-1), mCounter(0) { }
68 void newValue(int v) {
69 if (v>=mMax) {
70 mMax = v;
71 mSecondMax = -1;
72 mCounter = 0;
73 } else {
74 if (v>mSecondMax) {
75 mSecondMax = v;
76 }
77 if (++mCounter >= FRAMES) {
78 mMax = mSecondMax;
79 mSecondMax = -1;
80 mCounter = 0;
81 }
82 }
83 }
84 int getMax() const {
85 return mMax;
86 }

Callers 1

initMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected