Skip to content

Commit d2d8bad

Browse files
committed
fix typo MemoryGarbageCollectorSettings
1 parent 9b6f1e6 commit d2d8bad

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

Firestore/core/src/api/settings.cc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ std::unique_ptr<LocalCacheSettings> Settings::CopyCacheSettings(
6969
UNREACHABLE();
7070
}
7171

72-
std::unique_ptr<MemoryGargabeCollectorSettings>
72+
std::unique_ptr<MemoryGarbageCollectorSettings>
7373
MemoryCacheSettings::CopyMemoryGcSettings(
74-
const MemoryGargabeCollectorSettings& settings) {
74+
const MemoryGarbageCollectorSettings& settings) {
7575
if (settings.kind() ==
76-
MemoryGargabeCollectorSettings::MemoryGcKind::kEagerGc) {
76+
MemoryGarbageCollectorSettings::MemoryGcKind::kEagerGc) {
7777
return absl::make_unique<MemoryEagerGcSettings>(
7878
static_cast<const MemoryEagerGcSettings&>(settings));
7979
} else if (settings.kind() ==
80-
MemoryGargabeCollectorSettings::MemoryGcKind::kLruGc) {
80+
MemoryGarbageCollectorSettings::MemoryGcKind::kLruGc) {
8181
return absl::make_unique<MemoryLruGcSettings>(
8282
static_cast<const MemoryLruGcSettings&>(settings));
8383
}
@@ -107,7 +107,7 @@ MemoryLruGcSettings MemoryLruGcSettings::WithSizeBytes(int64_t size) const {
107107
}
108108

109109
MemoryCacheSettings MemoryCacheSettings::WithMemoryGarbageCollectorSettings(
110-
const MemoryGargabeCollectorSettings& settings) {
110+
const MemoryGarbageCollectorSettings& settings) {
111111
MemoryCacheSettings new_settings(*this);
112112
new_settings.settings_ = CopyMemoryGcSettings(settings);
113113
return new_settings;
@@ -157,18 +157,18 @@ bool operator==(const LocalCacheSettings& lhs, const LocalCacheSettings& rhs) {
157157
UNREACHABLE();
158158
}
159159

160-
bool operator==(const MemoryGargabeCollectorSettings& lhs,
161-
const MemoryGargabeCollectorSettings& rhs) {
160+
bool operator==(const MemoryGarbageCollectorSettings& lhs,
161+
const MemoryGarbageCollectorSettings& rhs) {
162162
if (lhs.kind() != rhs.kind()) {
163163
return false;
164164
}
165165

166-
if (lhs.kind() == MemoryGargabeCollectorSettings::MemoryGcKind::kEagerGc) {
166+
if (lhs.kind() == MemoryGarbageCollectorSettings::MemoryGcKind::kEagerGc) {
167167
return static_cast<const MemoryEagerGcSettings&>(lhs) ==
168168
static_cast<const MemoryEagerGcSettings&>(rhs);
169169
}
170170

171-
if (lhs.kind() == MemoryGargabeCollectorSettings::MemoryGcKind::kLruGc) {
171+
if (lhs.kind() == MemoryGarbageCollectorSettings::MemoryGcKind::kLruGc) {
172172
return static_cast<const MemoryLruGcSettings&>(lhs) ==
173173
static_cast<const MemoryLruGcSettings&>(rhs);
174174
}
@@ -268,7 +268,7 @@ int64_t Settings::cache_size_bytes() const {
268268
auto* memory_cache_settings =
269269
static_cast<MemoryCacheSettings*>(cache_settings_.get());
270270
if (memory_cache_settings->gc_settings().kind() ==
271-
MemoryGargabeCollectorSettings::MemoryGcKind::kLruGc) {
271+
MemoryGarbageCollectorSettings::MemoryGcKind::kLruGc) {
272272
return static_cast<const MemoryLruGcSettings&>(
273273
memory_cache_settings->gc_settings())
274274
.size_bytes();
@@ -289,7 +289,7 @@ bool Settings::gc_enabled() const {
289289
auto* memory_cache_settings =
290290
static_cast<MemoryCacheSettings*>(cache_settings_.get());
291291
return memory_cache_settings->gc_settings().kind() ==
292-
MemoryGargabeCollectorSettings::MemoryGcKind::kLruGc &&
292+
MemoryGarbageCollectorSettings::MemoryGcKind::kLruGc &&
293293
static_cast<const MemoryLruGcSettings&>(
294294
memory_cache_settings->gc_settings())
295295
.size_bytes() != CacheSizeUnlimited;

Firestore/core/src/api/settings.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -133,38 +133,38 @@ class PersistentCacheSettings : public LocalCacheSettings {
133133
int64_t size_bytes_;
134134
};
135135

136-
class MemoryGargabeCollectorSettings {
136+
class MemoryGarbageCollectorSettings {
137137
public:
138138
enum class MemoryGcKind { kEagerGc, kLruGc };
139-
virtual ~MemoryGargabeCollectorSettings() = default;
140-
friend bool operator==(const MemoryGargabeCollectorSettings& lhs,
141-
const MemoryGargabeCollectorSettings& rhs);
139+
virtual ~MemoryGarbageCollectorSettings() = default;
140+
friend bool operator==(const MemoryGarbageCollectorSettings& lhs,
141+
const MemoryGarbageCollectorSettings& rhs);
142142
virtual size_t Hash() const = 0;
143143

144144
MemoryGcKind kind() const {
145145
return kind_;
146146
}
147147

148148
protected:
149-
explicit MemoryGargabeCollectorSettings(MemoryGcKind kind) : kind_(kind) {
149+
explicit MemoryGarbageCollectorSettings(MemoryGcKind kind) : kind_(kind) {
150150
}
151151
MemoryGcKind kind_;
152152
};
153153

154-
class MemoryEagerGcSettings : public MemoryGargabeCollectorSettings {
154+
class MemoryEagerGcSettings : public MemoryGarbageCollectorSettings {
155155
public:
156156
MemoryEagerGcSettings()
157-
: MemoryGargabeCollectorSettings(
158-
MemoryGargabeCollectorSettings::MemoryGcKind::kEagerGc) {
157+
: MemoryGarbageCollectorSettings(
158+
MemoryGarbageCollectorSettings::MemoryGcKind::kEagerGc) {
159159
}
160160
size_t Hash() const override;
161161
};
162162

163-
class MemoryLruGcSettings : public MemoryGargabeCollectorSettings {
163+
class MemoryLruGcSettings : public MemoryGarbageCollectorSettings {
164164
public:
165165
MemoryLruGcSettings()
166-
: MemoryGargabeCollectorSettings(
167-
MemoryGargabeCollectorSettings::MemoryGcKind::kLruGc),
166+
: MemoryGarbageCollectorSettings(
167+
MemoryGarbageCollectorSettings::MemoryGcKind::kLruGc),
168168
size_bytes_(Settings::DefaultCacheSizeBytes) {
169169
}
170170

@@ -193,17 +193,17 @@ class MemoryCacheSettings : public LocalCacheSettings {
193193
size_t Hash() const override;
194194

195195
MemoryCacheSettings WithMemoryGarbageCollectorSettings(
196-
const MemoryGargabeCollectorSettings& settings);
196+
const MemoryGarbageCollectorSettings& settings);
197197

198-
const MemoryGargabeCollectorSettings& gc_settings() const {
198+
const MemoryGarbageCollectorSettings& gc_settings() const {
199199
return *settings_;
200200
}
201201

202202
private:
203-
static std::unique_ptr<MemoryGargabeCollectorSettings> CopyMemoryGcSettings(
204-
const MemoryGargabeCollectorSettings& settings);
203+
static std::unique_ptr<MemoryGarbageCollectorSettings> CopyMemoryGcSettings(
204+
const MemoryGarbageCollectorSettings& settings);
205205

206-
std::unique_ptr<MemoryGargabeCollectorSettings> settings_;
206+
std::unique_ptr<MemoryGarbageCollectorSettings> settings_;
207207
};
208208

209209
bool operator!=(const Settings& lhs, const Settings& rhs);

0 commit comments

Comments
 (0)