[v10.3.x] Field: Fix perf regression in getUniqueFieldName() (#81415)

Field: Fix perf regression in getUniqueFieldName() (#81323)

Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
(cherry picked from commit 0530021396)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
This commit is contained in:
grafana-delivery-bot[bot]
2024-01-26 16:56:57 -06:00
committed by GitHub
co-authored by Leon Sorokin
parent 7bdc53053b
commit 3d2005cd9b
2 changed files with 6 additions and 12 deletions
@@ -1,5 +1,3 @@
import { isEqual } from 'lodash';
import { DataFrame, Field, TIME_SERIES_VALUE_FIELD_NAME, FieldType, TIME_SERIES_TIME_FIELD_NAME } from '../types';
import { formatLabels } from '../utils/labels';
@@ -167,7 +165,7 @@ export function getUniqueFieldName(field: Field, frame?: DataFrame) {
for (let i = 0; i < frame.fields.length; i++) {
const otherField = frame.fields[i];
if (isEqual(field, otherField)) {
if (field === otherField) {
foundSelf = true;
if (dupeCount > 0) {