Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -701,8 +701,9 @@ public IndexCursor searchMoreLikeThis(final Set<RID> sourceRids, final MoreLikeT
final List<String> propertyNames = getPropertyNames();

if (propertyNames != null && !propertyNames.isEmpty()) {
final DatabaseInternal db = underlyingIndex.getComponent().getDatabase();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

While the current implementation is correct, you can simplify the retrieval of the database instance by using the getComponent() method already available in this class, which delegates to the underlying index.

Suggested change
final DatabaseInternal db = underlyingIndex.getComponent().getDatabase();
final DatabaseInternal db = getComponent().getDatabase();

for (final RID sourceRid : sourceRids) {
final Identifiable identifiable = sourceRid.getRecord();
final Identifiable identifiable = db.lookupByRID(sourceRid, true);
if (identifiable == null)
continue;

Expand Down
Binary file not shown.
Loading