MCPcopy Create free account
hub / github.com/bytedance/bolt / indexOfFirstMismatch

Function indexOfFirstMismatch

bolt/common/caching/SsdFile.cpp:449–456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

447int32_t indexOfFirstMismatch(char* x, char* y, int n) {
448 for (auto i = 0; i < n; ++i) {
449 if (x[i] != y[i]) {
450 return i;
451 }
452 }
453 return -1;
454}
455} // namespace
456
457void SsdFile::verifyWrite(AsyncDataCacheEntry& entry, SsdRun ssdRun) {
458 auto testData = std::make_unique<char[]>(entry.size());
459 const auto rc = ::pread(fd_, testData.get(), entry.size(), ssdRun.offset());

Callers 1

verifyWriteMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected