MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / WriteByte

Method WriteByte

src/saveload/saveload.cpp:155–164  ·  view source on GitHub ↗

* Write a single byte into the dumper. * @param b The byte to write. */

Source from the content-addressed store, hash-verified

153 * @param b The byte to write.
154 */
155 inline void WriteByte(uint8_t b)
156 {
157 /* Are we at the end of this chunk? */
158 if (this->buf == this->bufe) {
159 this->buf = this->blocks.emplace_back(std::make_unique<uint8_t[]>(MEMORY_CHUNK_SIZE)).get();
160 this->bufe = this->buf + MEMORY_CHUNK_SIZE;
161 }
162
163 *this->buf++ = b;
164 }
165
166 /**
167 * Flush this dumper into a writer.

Callers 1

SlWriteByteFunction · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected