BNode: Set fCStatus in SetTo() explicitly
instead of setting it in _SetTo() and then again in SetTo() fCStatus could be set even fewer times but this is a good compromise (logically, performance wise it is not an issue). Update copyright, add myself to Authors
This commit is contained in:
@@ -1,9 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 Haiku, Inc. All rights reserved.
|
* Copyright 2002-2016 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* Tyler Dauwalder
|
* Tyler Dauwalder
|
||||||
|
* John Scipione, [email protected]
|
||||||
* Ingo Weinhold, [email protected]
|
* Ingo Weinhold, [email protected]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -168,7 +169,9 @@ BNode::InitCheck() const
|
|||||||
status_t
|
status_t
|
||||||
BNode::SetTo(const entry_ref* ref)
|
BNode::SetTo(const entry_ref* ref)
|
||||||
{
|
{
|
||||||
return _SetTo(ref, false);
|
fCStatus = _SetTo(ref, false);
|
||||||
|
|
||||||
|
return fCStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -177,17 +180,20 @@ BNode::SetTo(const BEntry* entry)
|
|||||||
{
|
{
|
||||||
if (entry == NULL) {
|
if (entry == NULL) {
|
||||||
Unset();
|
Unset();
|
||||||
return (fCStatus = B_BAD_VALUE);
|
fCStatus = B_BAD_VALUE;
|
||||||
}
|
} else
|
||||||
|
fCStatus = _SetTo(entry->fDirFd, entry->fName, false);
|
||||||
|
|
||||||
return _SetTo(entry->fDirFd, entry->fName, false);
|
return fCStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BNode::SetTo(const char* path)
|
BNode::SetTo(const char* path)
|
||||||
{
|
{
|
||||||
return _SetTo(-1, path, false);
|
fCStatus = _SetTo(-1, path, false);
|
||||||
|
|
||||||
|
return fCStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -197,10 +203,11 @@ BNode::SetTo(const BDirectory* dir, const char* path)
|
|||||||
if (dir == NULL || path == NULL
|
if (dir == NULL || path == NULL
|
||||||
|| BPrivate::Storage::is_absolute_path(path)) {
|
|| BPrivate::Storage::is_absolute_path(path)) {
|
||||||
Unset();
|
Unset();
|
||||||
return (fCStatus = B_BAD_VALUE);
|
fCStatus = B_BAD_VALUE;
|
||||||
}
|
} else
|
||||||
|
fCStatus = _SetTo(dir->fDirFd, path, false);
|
||||||
|
|
||||||
return _SetTo(dir->fDirFd, path, false);
|
return fCStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user