Closed Bug 168916 Opened 23 years ago Closed 23 years ago

Removing unecessary redundancy in nsContextMenu.js

Categories

(SeaMonkey :: UI Design, defect)

x86
All
defect
Not set
trivial

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: fv8l1rxj1, Assigned: bugzilla)

Details

(Keywords: perf)

Attachments

(1 file, 2 obsolete files)

I know that this is trivial, but wouldn't it be better coding to remove reduntant checks from the nsContextMenu.js file? I mean why performing the same operation multiple times instead of performing it just once and saving the result to a temp variable? Why using this.showItem( "context-back", !( this.isTextSelected || this.onLink || this.onImage || this.onTextInput ) ); this.showItem( "context-forward", !( this.isTextSelected || this.onLink || this.onImage || this.onTextInput ) ); instead of var showNav = !( this.isTextSelected || this.onLink || this.onImage || this.onTextInput ); this.showItem( "context-back", showNav ); this.showItem( "context-forward", showNav ); ???
Attached file Modified nsContextMenu.js (obsolete) —
The attached nsContextMenu performs 2 and-operations, 7 not-operations and 35 or-operations less than the currently used one and that every time the context menu is opened. But there is no difference in functionality.
Could you please attach this as a patch against the current nsContextMenu.js? If you don't use CVS, but are just working with chrome, I believe you can generate it with Patch Maker. <URL:http://www.gerv.net/software/patch-maker/> Thanks.
Assignee: asa → blaker
Status: UNCONFIRMED → NEW
Component: Browser-General → XP Apps: GUI Features
Ever confirmed: true
QA Contact: asa → paw
> Could you please attach this as a patch against the current nsContextMenu.js? If > you don't use CVS, but are just working with chrome, I believe you can generate > it with Patch Maker. <URL:http://www.gerv.net/software/patch-maker/> Thanks. Can't run Patch Maker, have no Perl interpreter installed and CVS is kinda an overkill for me to run (I have only a CVS tool in my Java IDE, which I never used so far). However, what you want me to generate is a file one can use together with the Linux/UNIX tool "patch", isn't it? Can't I generate such a file using the "diff" command? As I have this command available on Windows (thansk to Cygwin) and I could attach the output here as file if you like.
A "diff -u" would be great, yes.
Attached patch diff -u output (obsolete) — Splinter Review
Here's the "diff -u" output that shows the changes which have been made.
Attachment #99346 - Attachment is obsolete: true
Keywords: perf
Attached patch new fixSplinter Review
The old patch bitrotted -- here's an updated patch.
Attachment #99524 - Attachment is obsolete: true
Attachment #119829 - Flags: review?(blaker)
Attachment #119829 - Flags: review?(blaker) → review?(choess)
Comment on attachment 119829 [details] [diff] [review] new fix r=choess
Attachment #119829 - Flags: review?(choess) → review+
Attachment #119829 - Flags: superreview?(jaggernaut)
Comment on attachment 119829 [details] [diff] [review] new fix sr=jag
Attachment #119829 - Flags: superreview?(jaggernaut) → superreview+
Attachment #119829 - Flags: approval1.4b?
Comment on attachment 119829 [details] [diff] [review] new fix a=sspitzer
Attachment #119829 - Flags: approval1.4b? → approval1.4b+
Attachment #119829 - Flags: approval1.4?
what happened here? did this have r/sr/a for 1.4 beta, but never checked in?
probably (I don't have checkin privs, and neither does Steve AFAIK)
Comment on attachment 119829 [details] [diff] [review] new fix a=asa (on behalf of drivers) for checkin to 1.4.
Attachment #119829 - Flags: approval1.4? → approval1.4+
Fix checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Product: Core → Mozilla Application Suite
Component: XP Apps: GUI Features → UI Design
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: