Page MenuHome

Cleanup interface_handlers.c
ClosedPublic

Authored by Valentin (Poulpator) on Aug 22 2020, 3:33 PM.

Details

Summary
  • Reduce variables scope
  • Use some const
  • initialize variables at declaration

Diff Detail

Repository
rB Blender
Branch
copy-cleanup (branched from master)
Build Status
Buildable 9781
Build 9781: arc lint + arc unit

Event Timeline

Valentin (Poulpator) requested review of this revision.Aug 22 2020, 3:33 PM
Hans Goudey (HooglyBoogly) requested changes to this revision.Aug 22 2020, 9:31 PM

Thanks for doing this. One one hand it's pretty surface level stuff, but IMO it's also a good first step in reducing the messiness of this code. Just a few notes:

source/blender/editors/interface/interface_handlers.c
1632–1637

You should be able to use LISTBASE_FOREACH_INDEX here, which I just recently added.

2775–2777

I think it would be best if you move it just a bit further, into the for loop.

4942

You could just remove this

This revision now requires changes to proceed.Aug 22 2020, 9:31 PM
  • Adressed comment
  • Also added few checks to false instead of 0 for bool value, sorry I didn't added them in the first pass
This revision is now accepted and ready to land.Aug 25 2020, 7:57 PM
This revision was automatically updated to reflect the committed changes.