Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b7d883c9 authored by Henri Chataing's avatar Henri Chataing
Browse files

Gd: Fix readability-braces-around-statements warnings

This change is part of the clang-tidy warning cleanup in
RootCanal.

Test: NA
Change-Id: Ibd3d7c9a817a929aaef2f3bedf1ab2a75a1b8d14
parent 3b190fb0
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -28,10 +28,12 @@ RawBuilder::RawBuilder(size_t max_bytes) : max_bytes_(max_bytes) {}
RawBuilder::RawBuilder(std::vector<uint8_t> vec) : payload_(std::move(vec)) {}

bool RawBuilder::AddOctets(size_t octets, const std::vector<uint8_t>& bytes) {
  if (payload_.size() + octets > max_bytes_) return false;

  if (octets != bytes.size()) return false;

  if (payload_.size() + octets > max_bytes_) {
    return false;
  }
  if (octets != bytes.size()) {
    return false;
  }
  payload_.insert(payload_.end(), bytes.begin(), bytes.end());

  return true;
@@ -46,15 +48,17 @@ bool RawBuilder::AddOctets(size_t octets, uint64_t value) {

  uint64_t v = value;

  if (octets > sizeof(uint64_t)) return false;

  if (octets > sizeof(uint64_t)) {
    return false;
  }
  for (size_t i = 0; i < octets; i++) {
    val_vector.push_back(v & 0xff);
    v = v >> 8;
  }

  if (v != 0) return false;

  if (v != 0) {
    return false;
  }
  return AddOctets(octets, val_vector);
}