From e56e1a71c3d21e42185a4410f53cfc8ae70808ac Mon Sep 17 00:00:00 2001 From: Sam Lanning Date: Tue, 11 Dec 2018 12:26:32 -0800 Subject: [PATCH] [chore] fix useless assignments to local variables This commit addresses all the instances of useless assignments to local variables, as found by LGTM.com --- components/icon/index.tsx | 2 +- components/table/Table.tsx | 4 +--- components/tree/DirectoryTree.tsx | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/components/icon/index.tsx b/components/icon/index.tsx index 938efd80e8..1ba9c8802c 100755 --- a/components/icon/index.tsx +++ b/components/icon/index.tsx @@ -138,7 +138,7 @@ const Icon: IconComponent = props => { ); } computedType = withThemeSuffix( - removeTypeTheme(alias(type)), + removeTypeTheme(alias(computedType)), dangerousTheme || theme || defaultTheme, ); innerNode = ( diff --git a/components/table/Table.tsx b/components/table/Table.tsx index 446b6a5ea8..2f373d6aa1 100755 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -554,10 +554,8 @@ export default class Table extends React.Component, TableState< handleRadioSelect = (record: T, rowIndex: number, e: RadioChangeEvent) => { const checked = e.target.checked; const nativeEvent = e.nativeEvent; - const defaultSelection = this.store.getState().selectionDirty ? [] : this.getDefaultSelection(); - let selectedRowKeys = this.store.getState().selectedRowKeys.concat(defaultSelection); const key = this.getRecordKey(record, rowIndex); - selectedRowKeys = [key]; + const selectedRowKeys = [key]; this.store.setState({ selectionDirty: true, }); diff --git a/components/tree/DirectoryTree.tsx b/components/tree/DirectoryTree.tsx index 611d06fba2..d63f77591c 100644 --- a/components/tree/DirectoryTree.tsx +++ b/components/tree/DirectoryTree.tsx @@ -143,7 +143,7 @@ export default class DirectoryTree extends React.Component