After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 648516 - Little comment error and 2 useless lines of code
Little comment error and 2 useless lines of code
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.28.x
Other Linux
: Normal trivial
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-04-23 17:26 UTC by Yann SOUBEYRAND
Modified: 2011-11-30 03:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch that fixes the comment error (783 bytes, patch)
2011-07-25 11:44 UTC, Yann SOUBEYRAND
none Details | Review
Patch that removes the two useless lines of code (797 bytes, patch)
2011-07-25 11:45 UTC, Yann SOUBEYRAND
none Details | Review
Remove two useless lines of code (845 bytes, patch)
2011-11-30 03:22 UTC, Matthias Clasen
committed Details | Review
Fix a little comment error in the _GTreeNode struct (831 bytes, patch)
2011-11-30 03:22 UTC, Matthias Clasen
committed Details | Review

Description Yann SOUBEYRAND 2011-04-23 17:26:34 UTC
Hi!

I'm studying the gtree.c file in order to see how the GTree structure is implemented and to understand how the algorithmes work. If I'm not mistaken the comment at the line 97 (/* height (left) - height (right) */) is wrong: according to the algorithmes it should be /* height (right) - height (left) */. I've also noticed that the 2 lines of code respectively at line 1256 (node->right = right;) and line 1298 (node->left = left;) are useless because they don't do anything (if I'm not mistaken). I can provide you with a patch if you want.

Bye!
Comment 1 Matthias Clasen 2011-04-26 13:36:36 UTC
I think you are correct.
Comment 2 André Klapper 2011-06-19 15:07:28 UTC
Patch welcome - also see http://live.gnome.org/GnomeLove/SubmittingPatches
Comment 3 Yann SOUBEYRAND 2011-07-25 11:44:16 UTC
Created attachment 192609 [details] [review]
Patch that fixes the comment error
Comment 4 Yann SOUBEYRAND 2011-07-25 11:45:03 UTC
Created attachment 192610 [details] [review]
Patch that removes the two useless lines of code
Comment 5 Yann SOUBEYRAND 2011-07-25 11:46:04 UTC
Here are the patches. I hope I did it the right way (I've followed tour link).
Comment 6 Baptiste Mille-Mathias 2011-11-04 20:21:29 UTC
Hi Matthias, 

could you review the patches attached ?

Thanks
Comment 7 Matthias Clasen 2011-11-30 03:21:13 UTC
The patches look fine.
Comment 8 Matthias Clasen 2011-11-30 03:22:22 UTC
The following fixes have been pushed:
22748db Remove two useless lines of code
27e7080 Fix a little comment error in the _GTreeNode struct
Comment 9 Matthias Clasen 2011-11-30 03:22:25 UTC
Created attachment 202417 [details] [review]
Remove two useless lines of code
Comment 10 Matthias Clasen 2011-11-30 03:22:27 UTC
Created attachment 202418 [details] [review]
Fix a little comment error in the _GTreeNode struct