Remove a dead conditional: info_ can only be allocated if FD is good. Improve

spacing


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29172 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2006-07-18 07:03:14 +00:00
parent 0af7093532
commit 84bad2f96c

View File

@ -44,12 +44,12 @@ void MappedFile::initialize() {
throw std::string("Can't open file: ") + path_.toString();
int mode = 0;
if (options_&READ_ACCESS)
if (options_&WRITE_ACCESS)
if (options_ & READ_ACCESS)
if (options_ & WRITE_ACCESS)
mode = O_RDWR;
else
mode = O_RDONLY;
else if (options_&WRITE_ACCESS)
else if (options_ & WRITE_ACCESS)
mode = O_WRONLY;
int FD = ::open(path_.c_str(), mode);
@ -68,8 +68,7 @@ void MappedFile::initialize() {
void MappedFile::terminate() {
assert(info_ && "MappedFile not initialized");
if (info_->FD >= 0)
::close(info_->FD);
::close(info_->FD);
delete info_;
info_ = 0;
}