Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use more ranges #4956

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

PastaPastaPasta
Copy link
Member

No description provided.

@PastaPastaPasta PastaPastaPasta added this to the 18.1 milestone Aug 5, 2022
@PastaPastaPasta PastaPastaPasta requested a review from UdjinM6 August 5, 2022 19:28
@github-actions
Copy link

github-actions bot commented Aug 6, 2022

This pull request has conflicts, please rebase.

@UdjinM6
Copy link

UdjinM6 commented Aug 8, 2022

pls rebase to include #4957

Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls see 1bef0b2 (ok, I see why it's not the right way to fix it) and a125cb4

@PastaPastaPasta
Copy link
Member Author

Why the first commit?

@UdjinM6
Copy link

UdjinM6 commented Aug 9, 2022

Why the first commit?

template version
template< class InputIt1, class InputIt2 >
bool equal( InputIt1 first1, InputIt1 last1, InputIt2 first2 );
(until C++20)
template< class InputIt1, class InputIt2 >
constexpr bool equal( InputIt1 first1, InputIt1 last1, InputIt2 first2 );
(since C++20)

https://en.cppreference.com/w/cpp/algorithm/equal

@PastaPastaPasta
Copy link
Member Author

PastaPastaPasta commented Aug 9, 2022

This is the one we're using here, still exists after c++20 (it simply becomes constexpr)

image

@UdjinM6
Copy link

UdjinM6 commented Aug 9, 2022

Hmm.. No...

More like
Screenshot 2022-08-10 at 00 01 09
for src/validation.cpp and
Screenshot 2022-08-10 at 00 01 01
for src/evo/simplifiedmns.cpp and src/rpc/server.cpp

you changed it to be (7) instead which broke tests ("bad-cb-height")

src/validation.cpp Outdated Show resolved Hide resolved
@github-actions
Copy link

This pull request has conflicts, please rebase.

# Conflicts:
#	src/validation.cpp
@PastaPastaPasta PastaPastaPasta changed the title Refactor: use more ranges refactor: use more ranges Sep 5, 2024
@PastaPastaPasta
Copy link
Member Author

@UdjinM6 I've revived this, please review

@@ -595,8 +596,7 @@ static bool ExecuteCommand(const CRPCCommand& command, const JSONRPCRequest& req
continue;
}

if (std::equal(vecAllowedParam.begin(), vecAllowedParam.end(),
request.params.getValues().begin(),
if (ranges::equal(vecAllowedParam, request.params.getValues(),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this broke rpc_platform_filter.py

Copy link

This pull request has conflicts, please rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants