| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
@ironfede Looks to me like the root should also optionally throw if ValidationExceptionEnabled is set? i.e. private void LoadChildren(RBTree bst, IDirectoryEntry de)
{
if (de.Child != DirectoryEntry.NOSTREAM)
{
IDirectoryEntry child = directoryEntries[de.Child];
// if (child.StgType != StgType.StgInvalid) // Should actually throw?
{
List<int> levelSIDs = new List<int>();
LoadChildren(bst, child, levelSIDs);
}
}
}
WDYT? |
Sorry, something went wrong.
There was a problem hiding this comment.
@jeremy-visionaid I think thats named used in methods are not 100% representative or their function. For example SiblingIsValid seems to imply it checks for "validity" but it really checks for "existance" of sibling AND do validation. So I think it should be renamed "HasSiblings" and internally throws for validity exception.
Sorry, something went wrong.
I think it should throw. |
Sorry, something went wrong.
Ensure both the root and left sibilings are considered when checking for duplicate SIDs. Also, remove redundant lookups.
Hmm, I might take it further and say that the method actually isn't even aware of sibilings - only the caller is, so "HasSiblings" is also arguably misleading. I think perhaps I could just rewrite it to avoid having a boolean return at all. |
Sorry, something went wrong.
|
@ironfede I've rewriten to avoid having a bool method, and added another commit on top that fixes the case where an exception was not thrown if the root entry was invalid too. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Ensure both the root and left sibilings are considered when checking for duplicate SIDs.
Also, remove redundant lookups.