MCPcopy Create free account
hub / github.com/chrxh/alien / writeOptionalByte

Function writeOptionalByte

source/EngineInterface/GenomeDescriptionService.cpp:15–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13 data.emplace_back(static_cast<uint8_t>(value));
14 }
15 void writeOptionalByte(std::vector<uint8_t>& data, std::optional<int> value)
16 {
17 data.emplace_back(static_cast<uint8_t>(value.value_or(-1)));
18 }
19 void writeByteWithInfinity(std::vector<uint8_t>& data, int value)
20 {
21 data.emplace_back(static_cast<uint8_t>(std::min(255, value)));

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected