Skip to content

Commit 9d2d806

Browse files
darkwingjasonLaster
authored andcommitted
Condense code for getHasMatchingGeneratedSource (firefox-devtools#7055)
1 parent dfcc2c8 commit 9d2d806

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/components/PrimaryPanes/SourcesTreeItem.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { showMenu } from "devtools-contextmenu";
1212
import SourceIcon from "../shared/SourceIcon";
1313
import Svg from "../shared/Svg";
1414

15-
import { getSourcesByURL } from "../../selectors";
15+
import { getSourceByURL } from "../../selectors";
1616
import actions from "../../actions";
1717

1818
import { isOriginal as isOriginalSource } from "../../utils/source";
@@ -191,11 +191,7 @@ function getHasMatchingGeneratedSource(state, source: ?Source) {
191191
return false;
192192
}
193193

194-
const sources = getSourcesByURL(state, source.url).filter(
195-
src => !isOriginalSource(src)
196-
);
197-
198-
return sources.length > 0;
194+
return !!getSourceByURL(state, source.url, false);
199195
}
200196

201197
const mapStateToProps = (state, props) => {

0 commit comments

Comments
 (0)