Simplify datasets assignment
This commit is contained in:
@@ -369,7 +369,7 @@ function ComparePerformanceWithData(props: {
|
|||||||
}) {
|
}) {
|
||||||
const { data } = props;
|
const { data } = props;
|
||||||
|
|
||||||
const datasets = useMemo(
|
const { from, to } = useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
from: new ComparisonDataset(data.from),
|
from: new ComparisonDataset(data.from),
|
||||||
to: new ComparisonDataset(data.to),
|
to: new ComparisonDataset(data.to),
|
||||||
@@ -387,8 +387,6 @@ function ComparePerformanceWithData(props: {
|
|||||||
|
|
||||||
const [metric, setMetric] = useState<Metric>(metrics.tuples);
|
const [metric, setMetric] = useState<Metric>(metrics.tuples);
|
||||||
|
|
||||||
const { from, to } = datasets;
|
|
||||||
|
|
||||||
const nameSet = new Set(from.data.names);
|
const nameSet = new Set(from.data.names);
|
||||||
for (const name of to.data.names) {
|
for (const name of to.data.names) {
|
||||||
nameSet.add(name);
|
nameSet.add(name);
|
||||||
|
|||||||
Reference in New Issue
Block a user