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:
David Blaikie 2013-02-20 06:25:36 +00:00
parent 2fdacbc5b0
commit 532aff8cd0
2 changed files with 4 additions and 4 deletions

View File

@ -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); }

View File

@ -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);