Skip to content

Commit

Permalink
Replace lodash find with native Array::find. Fixes firefox-devtools#4343
Browse files Browse the repository at this point in the history
  • Loading branch information
digitarald authored and Johnny Khalil committed Oct 13, 2017
1 parent 1be5718 commit 531712a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/Editor/CallSites.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { connect } from "react-redux";
import { bindActionCreators } from "redux";
import { isEnabled } from "devtools-config";

import { range, keyBy, find, isEqualWith } from "lodash";
import { range, keyBy, isEqualWith } from "lodash";

import CallSite from "./CallSite";

Expand All @@ -19,7 +19,7 @@ import { getTokenLocation, isWasm } from "../../utils/editor";
import actions from "../../actions";

function getCallSiteAtLocation(callSites, location) {
return find(callSites, callSite =>
return callSites.find(callSite =>
isEqualWith(callSite.location, location, (cloc, loc) => {
return (
loc.line === cloc.start.line &&
Expand Down
4 changes: 2 additions & 2 deletions src/components/PrimaryPanes/Outline.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import actions from "../../actions";
import { getSelectedSource, getSymbols } from "../../selectors";
import "./Outline.css";
import PreviewFunction from "../shared/PreviewFunction";
import { uniq, find } from "lodash";
import { uniq } from "lodash";
import type {
SymbolDeclarations,
SymbolDeclaration
Expand Down Expand Up @@ -66,7 +66,7 @@ export class Outline extends Component {
}

const klass = classFunctions[0].klass;
const klassFunc = find(functions, func => func.name === klass);
const klassFunc = functions.find(func => func.name === klass);

return (
<div className="outline-list__class">
Expand Down

0 comments on commit 531712a

Please sign in to comment.