intrusive_list: Make Remove and IsEmpty stdlib compatible
Makes the name match the standard library equivalents. C++17 introduces non-member empty() which allows for nicer handling in generic contexts. May as well make the data structure compatible with it.
This commit is contained in:
parent
23d190f7b0
commit
a8ba15f0d5
3 changed files with 4 additions and 4 deletions
|
@ -91,7 +91,7 @@ public:
|
|||
* Removes node from list
|
||||
* @param node Node to remove from list.
|
||||
*/
|
||||
void Remove(reference node) {
|
||||
void remove(reference node) {
|
||||
node.UnlinkFromList();
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,7 @@ public:
|
|||
* Is this list empty?
|
||||
* @returns true if there are no nodes in this list.
|
||||
*/
|
||||
bool IsEmpty() {
|
||||
bool empty() const {
|
||||
return root->next == root.get();
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ bool ArmTranslatorVisitor::ConditionPassed(Cond cond) {
|
|||
|
||||
// non-AL cond
|
||||
|
||||
if (!ir.block.instructions.IsEmpty()) {
|
||||
if (!ir.block.instructions.empty()) {
|
||||
// We've already emitted instructions. Quit for now, we'll make a new block here later.
|
||||
cond_state = ConditionalState::Break;
|
||||
ir.SetTerm(IR::Term::LinkBlockFast{ir.current_location});
|
||||
|
|
|
@ -61,7 +61,7 @@ void DeadCodeElimination(IR::Block& block) {
|
|||
// We iterate over the instructions in reverse order.
|
||||
// This is because removing an instruction reduces the number of uses for earlier instructions.
|
||||
|
||||
if (block.instructions.IsEmpty()) {
|
||||
if (block.instructions.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue