Skip to content

Commit 9b91443

Browse files
author
svorenova
committed
Utility functions cont. (to be squashed)
1 parent 77a2f9a commit 9b91443

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/java_bytecode/java_types.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -512,13 +512,12 @@ class java_generic_symbol_typet : public symbol_typet
512512
/// in the vector of generic types.
513513
/// \param type The type we are looking for.
514514
/// \return The index of the type in the vector of generic types.
515-
optionalt<size_t> generic_type(const reference_typet &type) const
515+
optionalt<size_t> generic_type_index(const reference_typet &type) const
516516
{
517-
const size_t &index =
518-
std::find(generic_types().begin(), generic_types().end(), type) -
519-
generic_types().begin();
520-
if(index < generic_types().size())
521-
return index;
517+
const auto &type_pointer =
518+
std::find(generic_types().begin(), generic_types().end(), type);
519+
if(type_pointer != generic_types().end())
520+
return type_pointer - generic_types().begin();
522521
return {};
523522
}
524523
};

src/util/std_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ class class_typet:public struct_typet
410410
{
411411
for(const auto &b : bases())
412412
{
413-
if(to_symbol_type(b.type()).get(ID_identifier) == id)
413+
if(to_symbol_type(b.type()).get_identifier() == id)
414414
return b;
415415
}
416416
}

0 commit comments

Comments
 (0)