Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Unified Diff: runtime/vm/weak_table.h

Issue 2481873005: clang-format runtime/vm (Closed)
Patch Set: Merge Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/weak_code.cc ('k') | runtime/vm/weak_table.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/weak_table.h
diff --git a/runtime/vm/weak_table.h b/runtime/vm/weak_table.h
index 8489ddaee1a0385c7f5acf2a4a1612524665139a..5814bb036467d1f9a419d9a7c5b01d94e30eb78f 100644
--- a/runtime/vm/weak_table.h
+++ b/runtime/vm/weak_table.h
@@ -26,7 +26,7 @@ class WeakTable {
}
// Get a max size that avoids overflows.
const intptr_t kMaxSize =
- (kIntptrOne << (kBitsPerWord - 2)) / (kEntrySize * kWordSize);
+ (kIntptrOne << (kBitsPerWord - 2)) / (kEntrySize * kWordSize);
ASSERT(Utils::IsPowerOfTwo(kMaxSize));
if (size > kMaxSize) {
size = kMaxSize;
@@ -36,9 +36,7 @@ class WeakTable {
data_ = reinterpret_cast<intptr_t*>(calloc(size_, kEntrySize * kWordSize));
}
- ~WeakTable() {
- free(data_);
- }
+ ~WeakTable() { free(data_); }
static WeakTable* NewFrom(WeakTable* original) {
return new WeakTable(SizeFor(original->count(), original->size()));
@@ -49,11 +47,9 @@ class WeakTable {
intptr_t count() const { return count_; }
bool IsValidEntryAt(intptr_t i) const {
- ASSERT(((ValueAt(i) == 0) &&
- ((ObjectAt(i) == NULL) ||
- (data_[ObjectIndex(i)] == kDeletedEntry))) ||
- ((ValueAt(i) != 0) &&
- (ObjectAt(i) != NULL) &&
+ ASSERT(((ValueAt(i) == 0) && ((ObjectAt(i) == NULL) ||
+ (data_[ObjectIndex(i)] == kDeletedEntry))) ||
+ ((ValueAt(i) != 0) && (ObjectAt(i) != NULL) &&
(data_[ObjectIndex(i)] != kDeletedEntry)));
return (data_[ValueIndex(i)] != 0);
}
@@ -111,9 +107,7 @@ class WeakTable {
}
intptr_t limit() const { return LimitFor(size()); }
- intptr_t index(intptr_t i) const {
- return i * kEntrySize;
- }
+ intptr_t index(intptr_t i) const { return i * kEntrySize; }
void set_used(intptr_t val) {
ASSERT(val <= limit());
@@ -126,13 +120,9 @@ class WeakTable {
count_ = val;
}
- intptr_t ObjectIndex(intptr_t i) const {
- return index(i) + kObjectOffset;
- }
+ intptr_t ObjectIndex(intptr_t i) const { return index(i) + kObjectOffset; }
- intptr_t ValueIndex(intptr_t i) const {
- return index(i) + kValueOffset;
- }
+ intptr_t ValueIndex(intptr_t i) const { return index(i) + kValueOffset; }
void SetObjectAt(intptr_t i, RawObject* key) {
ASSERT(i >= 0);
« no previous file with comments | « runtime/vm/weak_code.cc ('k') | runtime/vm/weak_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698