MCPcopy Create free account
hub / github.com/ElementsProject/elements / peekBit

Function peekBit

src/simplicity/frame.h:55–57  ·  view source on GitHub ↗

Given a read frame, return the value of the cell at the cursor. * * Precondition: '*frame' is a valid read frame for 1 more cell. */

Source from the content-addressed store, hash-verified

53 * Precondition: '*frame' is a valid read frame for 1 more cell.
54 */
55static inline bool peekBit(const frameItem* frame) {
56 return 1 & (*(frame->edge - 1 - frame->offset / UWORD_BIT) >> (UWORD_BIT - (frame->offset % UWORD_BIT) - 1));
57}
58
59/* Given a read frame, return the value of the cell at the cursor and advance the cursor by one cell.
60 *

Callers 2

readBitFunction · 0.85
runTCOFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected