Riptide icon indicating copy to clipboard operation
Riptide copied to clipboard

Fix warnings

Open Branchyz opened this issue 3 years ago • 4 comments

Branchyz avatar Aug 16 '22 14:08 Branchyz

What warnings have you fixed? Most of the changes you've made are clean up (not all of which actually improve readability), but some add things that are unnecessary, and a few others will affect/change behavior of the code—why?

tom-weiland avatar Aug 16 '22 20:08 tom-weiland

I fixed some warnings that will appear in most IDE's. I made the following changes:

  • Replacing for loops with foreach loops.
  • Removed all default value initializations.
  • Removed unused imports.
  • Fixed a potential NullReferenceException.
  • Removed unnecessary else statements.

Branchyz avatar Aug 16 '22 20:08 Branchyz

What IDE are you using? I'm using Visual Studio (which is arguably the most commonly used IDE) and don't get any of these warnings...

tom-weiland avatar Aug 16 '22 23:08 tom-weiland

I'm using Jetbrains Rider

Branchyz avatar Aug 17 '22 06:08 Branchyz

I've integrated most of these changes in my latest clean up commit. For future pull requests, please make sure to build the solution locally before committing so that your changes are applied to the Unity package files as well (this happens automatically via post-build actions). Slightly more descriptive commit messages might be good too, as I initially had no idea what warnings you were referring to.

Also, the for -> foreach change you made in the Server class needed to be applied to the Client class as well. Thanks :)

tom-weiland avatar Sep 06 '22 03:09 tom-weiland