remove all this. use
Bug #1487989 reported by
kay van der Zander
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Switchboard Mouse & Touchpad Plug |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
In the code there are many 'this.'use this is not the way to go.
This pointer points to the hole class object using this. takes more time and are more actions for the cpu.
Why would you use this when it is not needed.
developers shouldn't use this pointer in any OO (Object Oriented) language
Changed in switchboard-plug-mouse-touchpad: | |
status: | New → Confirmed |
importance: | Undecided → High |
assignee: | nobody → Marcus Wichelmann (l-admin-3) |
Changed in switchboard-plug-mouse-touchpad: | |
milestone: | none → loki-beta1 |
Changed in switchboard-plug-mouse-touchpad: | |
assignee: | Marcus Wichelmann (l-admin-3) → nobody |
importance: | High → Medium |
Changed in switchboard-plug-mouse-touchpad: | |
milestone: | loki-beta1 → none |
To post a comment you must log in.
Hi,
please compare the by valac generated code when compiling a vala class with and without "this". Right, it's exactly the same, because C doesn't know anything about "this" references. It links the reference to the object anyway when calling the related method, so removing this wouln't have an advantage. Also the scheme I am using for placing "this" references to improve the code-readability is even recommended by some big vala projects, so Imo we should add it to our codestyle- guidelines instead of removing it from our projects.