mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 21:18:20 +00:00
Use ranges::reverse_view to fix a few reverse ranged-for loops
This commit is contained in:
parent
832f67e91c
commit
8640f92b1f
4 changed files with 14 additions and 11 deletions
|
@ -2,6 +2,8 @@
|
|||
|
||||
#include "zeek/Scope.h"
|
||||
|
||||
#include <ranges>
|
||||
|
||||
#include "zeek/Desc.h"
|
||||
#include "zeek/ID.h"
|
||||
#include "zeek/IntrusivePtr.h"
|
||||
|
@ -112,8 +114,8 @@ const IDPtr& lookup_ID(const char* name, const char* curr_module, bool no_global
|
|||
if ( ! explicit_global ) {
|
||||
bool need_export = check_export && (ID_module != GLOBAL_MODULE_NAME && ID_module != curr_module);
|
||||
|
||||
for ( auto s_i = scopes.rbegin(); s_i != scopes.rend(); ++s_i ) {
|
||||
const auto& id = (*s_i)->Find(fullname);
|
||||
for ( const auto& s_i : std::ranges::reverse_view(scopes) ) {
|
||||
const auto& id = s_i->Find(fullname);
|
||||
|
||||
if ( id ) {
|
||||
if ( need_export && ! id->IsExport() && ! in_debug )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue