Skip to content

Commit

Permalink
Permit performance comparisons across DBs
Browse files Browse the repository at this point in the history
The snippet seems to have been copied from 'findOtherQueryToCompare'
where it makes sense, but in the context of a performance comparison
we don't need this restriction.
  • Loading branch information
asgerf committed Jan 17, 2025
1 parent bba31c0 commit 666c26e
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions extensions/ql-vscode/src/query-history/query-history-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1128,18 +1128,13 @@ export class QueryHistoryManager extends DisposableObject {
fromItem: CompletedLocalQueryInfo,
allSelectedItems: CompletedLocalQueryInfo[],
): Promise<CompletedLocalQueryInfo | undefined> {
const dbName = fromItem.databaseName;

// If exactly 2 items are selected, return the one that
// isn't being used as the "from" item.
if (allSelectedItems.length === 2) {
const otherItem =
fromItem === allSelectedItems[0]
? allSelectedItems[1]
: allSelectedItems[0];
if (otherItem.databaseName !== dbName) {
throw new Error("Query databases must be the same.");
}
return otherItem;
}

Expand All @@ -1150,10 +1145,7 @@ export class QueryHistoryManager extends DisposableObject {
// Otherwise, present a dialog so the user can choose the item they want to use.
const comparableQueryLabels = this.treeDataProvider.allHistory
.filter(this.isSuccessfulCompletedLocalQueryInfo)
.filter(
(otherItem) =>
otherItem !== fromItem && otherItem.databaseName === dbName,
)
.filter((otherItem) => otherItem !== fromItem)
.map((item) => ({
label: this.labelProvider.getLabel(item),
description: item.databaseName,
Expand Down

0 comments on commit 666c26e

Please sign in to comment.