diff --git a/src/neighbor.cpp b/src/neighbor.cpp index c6ddca4bc9..361663890b 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -1740,7 +1740,7 @@ void Neighbor::requests_new2old() TODO: should have optional argument "id" to match ID if multiple requests ------------------------------------------------------------------------- */ -NeighRequest *Neighbor::find_request(void *classptr) +NeighRequest *Neighbor::find_request(void *classptr) const { if (classptr == nullptr) return nullptr; @@ -1768,11 +1768,11 @@ const std::vector Neighbor::get_pair_requests() const TODO: should have optional argument "id" to match ID if multiple requests ------------------------------------------------------------------------- */ -NeighList *Neighbor::find_list(void *classptr) +NeighList *Neighbor::find_list(void *classptr) const { if (classptr == nullptr) return nullptr; - for (int i = 0; i < nrequest; i++) + for (int i = 0; i < nlist; i++) if (lists[i]->requestor == classptr) return lists[i]; return nullptr; diff --git a/src/neighbor.h b/src/neighbor.h index d116b479ba..0a470a8f04 100644 --- a/src/neighbor.h +++ b/src/neighbor.h @@ -153,8 +153,8 @@ class Neighbor : protected Pointers { void exclusion_group_group_delete(int, int); // rm a group-group exclusion int exclude_setting(); // return exclude value to accelerator pkg - NeighList *find_list(void *); // find a neighbor request - NeighRequest *find_request(void *); // find a neighbor request + NeighList *find_list(void *) const; // find a neighbor list based on requestor + NeighRequest *find_request(void *) const; // find a neighbor request based on requestor const std::vector get_pair_requests() const; int any_full(); // Check if any old requests had full neighbor lists void build_collection(int); // build peratom collection array starting at the given index