forked from OSchip/llvm-project
Rename llvm::Optional<T>::Reset to 'reset' as per LLVM naming conventions.
Code review feedback on r175580 from Jordan Rose. llvm-svn: 175595
This commit is contained in:
parent
2fdacbc5b0
commit
532aff8cd0
|
@ -62,13 +62,13 @@ public:
|
|||
|
||||
Optional &operator=(const Optional &O) {
|
||||
if (!O)
|
||||
Reset();
|
||||
reset();
|
||||
else
|
||||
*this = *O;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Reset() {
|
||||
void reset() {
|
||||
if (hasVal) {
|
||||
(*this)->~T();
|
||||
hasVal = false;
|
||||
|
@ -76,7 +76,7 @@ public:
|
|||
}
|
||||
|
||||
~Optional() {
|
||||
Reset();
|
||||
reset();
|
||||
}
|
||||
|
||||
const T* getPointer() const { assert(hasVal); return reinterpret_cast<const T*>(storage.buffer); }
|
||||
|
|
|
@ -56,7 +56,7 @@ TEST_F(OptionalTest, ResetTest) {
|
|||
EXPECT_EQ(0u, NonDefaultConstructible::CopyAssignments);
|
||||
EXPECT_EQ(1u, NonDefaultConstructible::Destructions);
|
||||
NonDefaultConstructible::ResetCounts();
|
||||
O.Reset();
|
||||
O.reset();
|
||||
EXPECT_EQ(0u, NonDefaultConstructible::CopyConstructions);
|
||||
EXPECT_EQ(0u, NonDefaultConstructible::CopyAssignments);
|
||||
EXPECT_EQ(1u, NonDefaultConstructible::Destructions);
|
||||
|
|
Loading…
Reference in New Issue