Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#3907 closed defect (fixed)

[PATCH] Use range based for in network code

Reported by: elexis Owned by: Itms
Priority: If Time Permits Milestone: Alpha 21
Component: Network Keywords: patch
Cc: leper Patch:

Description

About r17730: 18:13 <@leper> and that loop could use a range based for

While wiki:Coding_Conventions only states that range-based for should be prefered over for-each, the network code exclusively uses numerical loops. This patch changes all loops in the 3 relevant network files. Disclaimer: I dont like the patch, didn't enjoy writing it, pointless churn, wasted time and don't care if it's closed as wont fix.

Attachments (2)

rangebasedfornetwork_v1.patch (9.4 KB ) - added by elexis 8 years ago.
network_cleanup.patch (23.2 KB ) - added by Itms 8 years ago.

Download all attachments as: .zip

Change History (7)

by elexis, 8 years ago

comment:1 by Itms, 8 years ago

Cc: leper added

I personally find it nice. I agree that it's never enjoyable to write such code but that's necessary if we want a tidy codebase.

Here is another version, with more cleanup and more const wherever possible.

comment:2 by Itms, 8 years ago

And another one, with more >> and less exposure of S_m_foo types.

by Itms, 8 years ago

Attachment: network_cleanup.patch added

comment:3 by Itms, 8 years ago

Owner: set to Itms
Resolution: fixed
Status: newclosed

In 18091:

Cleanup of the network code (range-based for, remove spaces between angle brackets, and other little things).
Based on a patch by elexis, fixes #3907

comment:4 by Itms, 8 years ago

Keywords: review removed

comment:5 by elexis, 8 years ago

Component: UI & SimulationNetwork

(changed component to network)

Note: See TracTickets for help on using tickets.