Skip to content

Commit

Permalink
fix: starting item sorting differently on mac (cataclysmbnteam#3814)
Browse files Browse the repository at this point in the history
fix: use `std::stable_sort`
  • Loading branch information
scarf005 authored Dec 6, 2023
1 parent f3d7db3 commit 87779f3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/profession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,8 @@ std::vector<detached_ptr<item>> profession::items( bool male,
}
}

std::sort( result.begin(),
result.end(), []( detached_ptr<item> &first,
detached_ptr<item> &second ) {
std::stable_sort( result.begin(), result.end(),
[]( const detached_ptr<item> &first, const detached_ptr<item> &second ) {
return first->get_layer() < second->get_layer();
} );
return result;
Expand Down

0 comments on commit 87779f3

Please sign in to comment.