mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-05 12:05:22 +00:00
Bug 177179
slightly optimize inDOMView::GetNodeTypeKey r=timeless/jkeiser sr=bzbarsky a=roc+moz
This commit is contained in:
parent
e0661af41f
commit
6865d45b89
@ -265,8 +265,7 @@ inDOMView::AddFilterByType(PRUint16 aType, PRBool aExclusive)
|
||||
NS_IMETHODIMP
|
||||
inDOMView::RemoveFilterByType(PRUint16 aType)
|
||||
{
|
||||
PRUint16 key = GetNodeTypeKey(aType);
|
||||
mFilters -= key;
|
||||
mFilters &= ~(GetNodeTypeKey(aType));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -1265,13 +1264,3 @@ inDOMView::AppendAttrsToArray(nsIDOMNamedNodeMap* aKids, nsISupportsArray* aArra
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRUint16
|
||||
inDOMView::GetNodeTypeKey(PRUint16 aType)
|
||||
{
|
||||
PRUint16 key = 1;
|
||||
for (PRUint32 i = 0; i < aType; ++i)
|
||||
key = key * 2;
|
||||
|
||||
return key;
|
||||
}
|
||||
|
@ -134,8 +134,8 @@ protected:
|
||||
nsCOMPtr<nsITreeBoxObject> mTree;
|
||||
nsCOMPtr<nsITreeSelection> mSelection;
|
||||
|
||||
PRBool mShowAnonymous;
|
||||
PRBool mShowSubDocuments;
|
||||
PRPackedBool mShowAnonymous;
|
||||
PRPackedBool mShowSubDocuments;
|
||||
PRUint32 mFilters;
|
||||
|
||||
nsCOMPtr<nsIDOMNode> mRootNode;
|
||||
@ -165,7 +165,12 @@ protected:
|
||||
void RemoveLink(inDOMViewNode* aNode);
|
||||
void ReplaceLink(inDOMViewNode* aNewNode, inDOMViewNode* aOldNode);
|
||||
|
||||
PRUint16 GetNodeTypeKey(PRUint16 aType);
|
||||
inline PRUint16 GetNodeTypeKey(PRUint16 aType)
|
||||
{
|
||||
NS_ASSERTION(aType < 16, "You doofus");
|
||||
return 1 << aType;
|
||||
};
|
||||
|
||||
nsresult GetChildNodesFor(nsIDOMNode* aNode, nsISupportsArray **aResult);
|
||||
nsresult AppendKidsToArray(nsIDOMNodeList* aKids, nsISupportsArray* aArray);
|
||||
nsresult AppendAttrsToArray(nsIDOMNamedNodeMap* aKids, nsISupportsArray* aArray);
|
||||
|
Loading…
Reference in New Issue
Block a user