Skip to content

Commit c294429

Browse files
authored
[Impeller] Avoid using the major and minor variable names. (flutter#36009)
1 parent 6610f3f commit c294429

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

impeller/base/version.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ std::optional<Version> Version::FromVector(const std::vector<size_t>& version) {
2626

2727
std::string Version::ToString() const {
2828
std::stringstream stream;
29-
stream << major << "." << minor << "." << patch;
29+
stream << major_version << "." << minor_version << "." << patch_version;
3030
return stream.str();
3131
}
3232

impeller/base/version.h

+9-6
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,21 @@ namespace impeller {
1414

1515
struct Version {
1616
public:
17-
size_t major;
18-
size_t minor;
19-
size_t patch;
17+
size_t major_version;
18+
size_t minor_version;
19+
size_t patch_version;
2020

2121
constexpr Version(size_t p_major = 0, size_t p_minor = 0, size_t p_patch = 0)
22-
: major(p_major), minor(p_minor), patch(p_patch) {}
22+
: major_version(p_major),
23+
minor_version(p_minor),
24+
patch_version(p_patch) {}
2325

2426
static std::optional<Version> FromVector(const std::vector<size_t>& version);
2527

2628
constexpr bool IsAtLeast(const Version& other) {
27-
return std::tie(major, minor, patch) >=
28-
std::tie(other.major, other.minor, other.patch);
29+
return std::tie(major_version, minor_version, patch_version) >=
30+
std::tie(other.major_version, other.minor_version,
31+
other.patch_version);
2932
}
3033

3134
std::string ToString() const;

0 commit comments

Comments
 (0)