Unnecessary loop in ContentSearchUIController._updateDefaultEngineIcon
Categories
(Firefox :: Search, task, P5)
Tracking
()
Tracking | Status | |
---|---|---|
firefox78 | --- | fixed |
People
(Reporter: standard8, Assigned: gaurijove, Mentored)
Details
(Keywords: good-first-bug, Whiteboard: [lang=js])
Attachments
(1 file)
Currently ContentSearchUIController._updateDefaultEngineIcon is iterating through the engines list to find out the identifier of the default engine:
let eng = this._engines.find(
engine => engine.name === this.defaultEngine.name
);
let icon =
eng && eng.identifier ? this.defaultEngine.icon : DEFAULT_INPUT_ICON;
Rather than iterating through the loop, we should simply store the identifier with alongside the name/icon in set defaultEngine(engine)
, we can then use that rather directly rather than looping through all the engines.
Reporter | ||
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
Hello, May I submit a patch for this? :)
Reporter | ||
Comment 2•5 years ago
|
||
(In reply to Jayati Shrivastava from comment #1)
Hello, May I submit a patch for this? :)
As this is a good first bug, and you've already done a few, could we leave this for a newer contributor? If you're looking for another bug then bug 1624733 is a bit more advanced, and don't forget about your other current assigned bugs as well.
Assignee | ||
Comment 3•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Comment 4•5 years ago
|
||
Sorry Mark. I missed seeing your comment before submitting the patch. Should I abandon it?
Comment 7•5 years ago
|
||
bugherder |
Description
•