MCPcopy Create free account
hub / github.com/devosoft/avida / GetBit

Method GetBit

avida-core/source/tools/cBitArray.h:150–154  ·  view source on GitHub ↗

For fast bit operations, we're not going to setup operator[]; instead we're going to have a GetBit and a SetBit commamd. For this raw version we're also going to assume that the index is within range w/o any special checks.

Source from the content-addressed store, hash-verified

148 // we're also going to assume that the index is within range w/o any special
149 // checks.
150 bool GetBit(const int index) const{
151 const int field_id = GetField(index);
152 const int pos_id = GetFieldPos(index);
153 return (bit_fields[field_id] & (1 << pos_id)) != 0;
154 }
155
156 void SetBit(const int index, const bool value) {
157 const int field_id = GetField(index);

Callers 1

GetMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected