Skip to content

Commit

Permalink
Fix typos (#12793)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrs1669 authored Apr 16, 2024
1 parent 09ed712 commit 4d721de
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 38 deletions.
22 changes: 11 additions & 11 deletions Firestore/core/src/api/settings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ std::unique_ptr<LocalCacheSettings> Settings::CopyCacheSettings(
UNREACHABLE();
}

std::unique_ptr<MemoryGargabeCollectorSettings>
std::unique_ptr<MemoryGarbageCollectorSettings>
MemoryCacheSettings::CopyMemoryGcSettings(
const MemoryGargabeCollectorSettings& settings) {
const MemoryGarbageCollectorSettings& settings) {
if (settings.kind() ==
MemoryGargabeCollectorSettings::MemoryGcKind::kEagerGc) {
MemoryGarbageCollectorSettings::MemoryGcKind::kEagerGc) {
return absl::make_unique<MemoryEagerGcSettings>(
static_cast<const MemoryEagerGcSettings&>(settings));
} else if (settings.kind() ==
MemoryGargabeCollectorSettings::MemoryGcKind::kLruGc) {
MemoryGarbageCollectorSettings::MemoryGcKind::kLruGc) {
return absl::make_unique<MemoryLruGcSettings>(
static_cast<const MemoryLruGcSettings&>(settings));
}
Expand Down Expand Up @@ -107,7 +107,7 @@ MemoryLruGcSettings MemoryLruGcSettings::WithSizeBytes(int64_t size) const {
}

MemoryCacheSettings MemoryCacheSettings::WithMemoryGarbageCollectorSettings(
const MemoryGargabeCollectorSettings& settings) {
const MemoryGarbageCollectorSettings& settings) {
MemoryCacheSettings new_settings(*this);
new_settings.settings_ = CopyMemoryGcSettings(settings);
return new_settings;
Expand Down Expand Up @@ -157,18 +157,18 @@ bool operator==(const LocalCacheSettings& lhs, const LocalCacheSettings& rhs) {
UNREACHABLE();
}

bool operator==(const MemoryGargabeCollectorSettings& lhs,
const MemoryGargabeCollectorSettings& rhs) {
bool operator==(const MemoryGarbageCollectorSettings& lhs,
const MemoryGarbageCollectorSettings& rhs) {
if (lhs.kind() != rhs.kind()) {
return false;
}

if (lhs.kind() == MemoryGargabeCollectorSettings::MemoryGcKind::kEagerGc) {
if (lhs.kind() == MemoryGarbageCollectorSettings::MemoryGcKind::kEagerGc) {
return static_cast<const MemoryEagerGcSettings&>(lhs) ==
static_cast<const MemoryEagerGcSettings&>(rhs);
}

if (lhs.kind() == MemoryGargabeCollectorSettings::MemoryGcKind::kLruGc) {
if (lhs.kind() == MemoryGarbageCollectorSettings::MemoryGcKind::kLruGc) {
return static_cast<const MemoryLruGcSettings&>(lhs) ==
static_cast<const MemoryLruGcSettings&>(rhs);
}
Expand Down Expand Up @@ -268,7 +268,7 @@ int64_t Settings::cache_size_bytes() const {
auto* memory_cache_settings =
static_cast<MemoryCacheSettings*>(cache_settings_.get());
if (memory_cache_settings->gc_settings().kind() ==
MemoryGargabeCollectorSettings::MemoryGcKind::kLruGc) {
MemoryGarbageCollectorSettings::MemoryGcKind::kLruGc) {
return static_cast<const MemoryLruGcSettings&>(
memory_cache_settings->gc_settings())
.size_bytes();
Expand All @@ -289,7 +289,7 @@ bool Settings::gc_enabled() const {
auto* memory_cache_settings =
static_cast<MemoryCacheSettings*>(cache_settings_.get());
return memory_cache_settings->gc_settings().kind() ==
MemoryGargabeCollectorSettings::MemoryGcKind::kLruGc &&
MemoryGarbageCollectorSettings::MemoryGcKind::kLruGc &&
static_cast<const MemoryLruGcSettings&>(
memory_cache_settings->gc_settings())
.size_bytes() != CacheSizeUnlimited;
Expand Down
32 changes: 16 additions & 16 deletions Firestore/core/src/api/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,38 +133,38 @@ class PersistentCacheSettings : public LocalCacheSettings {
int64_t size_bytes_;
};

class MemoryGargabeCollectorSettings {
class MemoryGarbageCollectorSettings {
public:
enum class MemoryGcKind { kEagerGc, kLruGc };
virtual ~MemoryGargabeCollectorSettings() = default;
friend bool operator==(const MemoryGargabeCollectorSettings& lhs,
const MemoryGargabeCollectorSettings& rhs);
virtual ~MemoryGarbageCollectorSettings() = default;
friend bool operator==(const MemoryGarbageCollectorSettings& lhs,
const MemoryGarbageCollectorSettings& rhs);
virtual size_t Hash() const = 0;

MemoryGcKind kind() const {
return kind_;
}

protected:
explicit MemoryGargabeCollectorSettings(MemoryGcKind kind) : kind_(kind) {
explicit MemoryGarbageCollectorSettings(MemoryGcKind kind) : kind_(kind) {
}
MemoryGcKind kind_;
};

class MemoryEagerGcSettings : public MemoryGargabeCollectorSettings {
class MemoryEagerGcSettings : public MemoryGarbageCollectorSettings {
public:
MemoryEagerGcSettings()
: MemoryGargabeCollectorSettings(
MemoryGargabeCollectorSettings::MemoryGcKind::kEagerGc) {
: MemoryGarbageCollectorSettings(
MemoryGarbageCollectorSettings::MemoryGcKind::kEagerGc) {
}
size_t Hash() const override;
};

class MemoryLruGcSettings : public MemoryGargabeCollectorSettings {
class MemoryLruGcSettings : public MemoryGarbageCollectorSettings {
public:
MemoryLruGcSettings()
: MemoryGargabeCollectorSettings(
MemoryGargabeCollectorSettings::MemoryGcKind::kLruGc),
: MemoryGarbageCollectorSettings(
MemoryGarbageCollectorSettings::MemoryGcKind::kLruGc),
size_bytes_(Settings::DefaultCacheSizeBytes) {
}

Expand Down Expand Up @@ -193,17 +193,17 @@ class MemoryCacheSettings : public LocalCacheSettings {
size_t Hash() const override;

MemoryCacheSettings WithMemoryGarbageCollectorSettings(
const MemoryGargabeCollectorSettings& settings);
const MemoryGarbageCollectorSettings& settings);

const MemoryGargabeCollectorSettings& gc_settings() const {
const MemoryGarbageCollectorSettings& gc_settings() const {
return *settings_;
}

private:
static std::unique_ptr<MemoryGargabeCollectorSettings> CopyMemoryGcSettings(
const MemoryGargabeCollectorSettings& settings);
static std::unique_ptr<MemoryGarbageCollectorSettings> CopyMemoryGcSettings(
const MemoryGarbageCollectorSettings& settings);

std::unique_ptr<MemoryGargabeCollectorSettings> settings_;
std::unique_ptr<MemoryGarbageCollectorSettings> settings_;
};

bool operator!=(const Settings& lhs, const Settings& rhs);
Expand Down
2 changes: 1 addition & 1 deletion ReleaseTooling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Other optional arguments:
- `--no-update-pod-repo`
- This is for speedups when `pod repo update` has already been run recently.
- `--minimum-ios-version <minimum-ios-version>`
- Change the minimimum iOS version from the default of 10.
- Change the minimum iOS version from the default of 10.
- `--output-dir <output-dir>`
- The directory to copy the built Zip file. If this is not set, the path to the Zip file will
be logged to the console.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ struct GHAMatrixSpecCollector {
if let spec = podsMap[specName] {
output.append(spec)
} else {
print("\(specName) is not in manifiest")
print("\(specName) is not in manifest")
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions ReleaseTooling/Sources/PodspecsTester/InitializeSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ enum InitializeSpecTesting {
for spec in specs {
let specInfo = fetchPodVersion(from: URL(fileURLWithPath: spec))
// Create directories `${HOME}/.cocoapods/${Pod}/${version}`
let podDirURL = createPodDirctory(
let podDirURL = createPodDirectory(
specRepoPath: Constants.cocoapodsDir,
podName: specInfo.name,
version: specInfo.version
Expand All @@ -147,7 +147,7 @@ enum InitializeSpecTesting {
}
// Closed source podspecs, e.g. `GoogleAppMeasurement.podspec`.
if path.pathExtension == "json" {
// Remove both extenstions of `podspec` and `json`.
// Remove both extensions of `podspec` and `json`.
podName = path.deletingPathExtension().deletingPathExtension().lastPathComponent
} else if path.pathExtension == "podspec" {
podName = path.deletingPathExtension().lastPathComponent
Expand Down Expand Up @@ -197,8 +197,8 @@ enum InitializeSpecTesting {
return versionMatches[0][1]
}

private static func createPodDirctory(specRepoPath: String, podName: String,
version: String) -> URL {
private static func createPodDirectory(specRepoPath: String, podName: String,
version: String) -> URL {
guard let specRepoURL = URL(string: specRepoPath) else {
fatalError("\(specRepoPath) does not exist.")
}
Expand Down
2 changes: 1 addition & 1 deletion ReleaseTooling/Sources/ZipBuilder/CocoaPodUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ enum CocoaPodUtils {

// The third component is the version in parentheses, potentially with a `:` at the end. Let's
// just strip the unused characters (including quotes) and return the version. We don't
// necesarily have to match against semver since it's a non trivial regex and we don't actually
// necessarily have to match against semver since it's a non trivial regex and we don't actually
// care, `Podfile.lock` has a standard format that we know will be valid. Also strip out any
// extra quotes.
let version = components[2].trimmingCharacters(in: CharacterSet(charactersIn: "():\""))
Expand Down
2 changes: 1 addition & 1 deletion ReleaseTooling/Sources/ZipBuilder/ResourcesManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ extension ResourcesManager {
try fileManager.removeItem(at: resourceDir)
} catch {
print("WARNING: Failed to remove empty Resources directory while cleaning up folder " +
"heirarchy: \(error)")
"hierarchy: \(error)")
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions scripts/create_spec_repo/Sources/SpecRepoBuilder/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public extension Date {
}
}

// SpecFiles is a wraper of dict mapping from required pods to their path. This
// SpecFiles is a wrapper of dict mapping from required pods to their path. This
// will also contain a sequence of installing podspecs.
class SpecFiles {
private var specFilesDict: [String: URL]
Expand Down Expand Up @@ -125,7 +125,7 @@ enum SpecRepoBuilderError: Error {
case failedToPush(pods: [String])
// Error occurs when a podspec is not found in the repo.
case podspecNotFound(_ podspec: String, from: String)
// Error occurs when a direotyr path cannot be determined.
// Error occurs when a directory path cannot be determined.
case pathNotFound(_ path: String)
}

Expand Down Expand Up @@ -238,7 +238,7 @@ struct SpecRepoBuilder: ParsableCommand {
if depPrefix.hasSuffix(Constants.specDependencyLabel) {
// e.g. In Firebase.podspec, Firebase/Core will not be considered a
// dependency.
// "ss.dependency 'Firebase/Core'" will be splited in
// "ss.dependency 'Firebase/Core'" will be splitted in
// ["ss.dependency", "'Firebase", "Core'"]
let podNameRaw = String(tokens[1]).replacingOccurrences(of: "'", with: "")
// In the example above, deps here will not include Firebase since
Expand Down

0 comments on commit 4d721de

Please sign in to comment.