Closed Bug 1937381 Opened 10 months ago Closed 8 months ago

Tidy up dumpObjectTree helper in cZ

Categories

(SeaMonkey :: Chat, enhancement)

enhancement

Tracking

(seamonkey2.53+ fixed)

RESOLVED FIXED
Future
Tracking Status
seamonkey2.53 + fixed

People

(Reporter: iannbugzilla, Assigned: iannbugzilla)

Details

(Whiteboard: SM2.53.21)

Attachments

(1 file, 1 obsolete file)

The compress argument for dumpObjectTree is always undefined/true so can be removed meaning the helper can be tidied, also make use of String repeat method.

[Approval Request Comment]
Regression caused by (bug #): n/a
User impact if declined: none
Testing completed (on m-c, etc.): 2.53.21pre
Risk to taking this patch (and alternatives if risky): low
String changes made by this patch: none

Attachment #9443694 - Flags: review?(frgrahl)
Attachment #9443694 - Flags: approval-comm-release?

Comment on attachment 9443694 [details] [diff] [review]
1937381-irc-tidy-dumpObjectTree-25321.patch

NIT recurse and level are currently not set in any call. Theoretically they could be removed too. recurse is used as a boolean in the comparision and value / bounds are not checked. I think this should be changed to recurse > 0 as a minimum check. Could not be undefined because it is set in the function to 0 in this case.

s could be a let too I think but that is nit-picking :) In the event of recursion different s are allocated and returned in the global scope.
r/a+ with this fixed.

             if ((i != "parent") && (recurse))
  •                s += dumpObjectTree (o[i], recurse - 1,
    
  •                                     compress, level + 1);
    
  •                s += dumpObjectTree(o[i], recurse - 1, level + 1);
    
Attachment #9443694 - Flags: review?(frgrahl)
Attachment #9443694 - Flags: review+
Attachment #9443694 - Flags: approval-comm-release?
Attachment #9443694 - Flags: approval-comm-release+

Remove unused recurse and level

Attachment #9443694 - Attachment is obsolete: true
Attachment #9466003 - Flags: review?(frgrahl)
Attachment #9466003 - Flags: approval-comm-release?

Comment on attachment 9466003 [details] [diff] [review]
1937381-irc-tidy-dumpObjectTree-v1_1-25321.patch

LGTM r/a+

Attachment #9466003 - Flags: review?(frgrahl)
Attachment #9466003 - Flags: review+
Attachment #9466003 - Flags: approval-comm-release?
Attachment #9466003 - Flags: approval-comm-release+

Pushed by frgrahl@gmx.net:
https://hg.mozilla.org/comm-central/rev/de9480d08b92
Tidy up dumpObjectTree helper in cZ. r=frg

Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Whiteboard: SM2.53.21
Target Milestone: --- → Future
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: