Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code cleanup for #4000 #4054

Merged
merged 2 commits into from
Dec 22, 2022
Merged

Code cleanup for #4000 #4054

merged 2 commits into from
Dec 22, 2022

Conversation

pheonixstorm
Copy link
Collaborator

Code change for PR #4000 Consolidated some code removing several if blocks moving them into a single if statement at the beginning of the function which relocated two class casts and removed multiple if statements for boolean variables. Not sure if it will have a positive impact on performance but it does clean up the code some.

… casts, and instanceof checks in favor of single if block
@codecov
Copy link

codecov bot commented Dec 17, 2022

Codecov Report

Base: 23.03% // Head: 23.00% // Decreases project coverage by -0.02% ⚠️

Coverage data is based on head (1975dde) compared to base (d1f0550).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #4054      +/-   ##
============================================
- Coverage     23.03%   23.00%   -0.03%     
  Complexity     4813     4813              
============================================
  Files          2263     2264       +1     
  Lines        248731   249501     +770     
  Branches      46244    46321      +77     
============================================
+ Hits          57283    57398     +115     
- Misses       189989   190644     +655     
  Partials       1459     1459              
Impacted Files Coverage Δ
megamek/src/megamek/server/ServerHelper.java 0.00% <0.00%> (ø)
...ek/common/weapons/battlearmor/CLBAMortarHeavy.java 85.00% <0.00%> (-15.00%) ⬇️
...ek/common/weapons/battlearmor/CLBAMortarLight.java 94.44% <0.00%> (-5.56%) ⬇️
megamek/src/megamek/Version.java 29.54% <0.00%> (-2.17%) ⬇️
...ek/src/megamek/client/ui/swing/GUIPreferences.java 33.71% <0.00%> (-0.39%) ⬇️
...c/megamek/common/preference/ClientPreferences.java 31.61% <0.00%> (-0.21%) ⬇️
megamek/src/megamek/common/Mech.java 15.45% <0.00%> (-0.01%) ⬇️
megamek/src/megamek/common/Entity.java 12.85% <0.00%> (-0.01%) ⬇️
...c/megamek/client/ui/swing/boardview/BoardView.java 0.62% <0.00%> (-0.01%) ⬇️
megamek/src/megamek/common/Tank.java 0.98% <0.00%> (-0.01%) ⬇️
... and 127 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@Windchild292 Windchild292 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One spacing issue, otherwise this looks good

@@ -404,36 +404,31 @@ else if ((entity.heat >= 14) && !entity.isShutDown()) {

public static void adjustHeatExtremeTemp(Game game, Entity entity, Vector<Report> vPhaseReport) {
Report r;
int tempDiff = game.getPlanetaryConditions().getTemperatureDifference(50, -30);
int tempDiff = game.getPlanetaryConditions().getTemperatureDifference(50, -30);
boolean heatArmor =false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
boolean heatArmor =false;
boolean heatArmor = false;

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@Windchild292 Windchild292 added Refactoring For New Dev Cycle This PR should be merged at the beginning of a dev cycle labels Dec 17, 2022
@Windchild292 Windchild292 merged commit 59b71c1 into MegaMek:master Dec 22, 2022
@pheonixstorm pheonixstorm deleted the Misc branch December 22, 2022 20:17
HammerGS added a commit to SJuliez/megamek that referenced this pull request May 25, 2024
MegaMek
+ Fix 5476: Update SV armor slots to 2 or 1 for Rating E or F respectively

MegaMekLab
+ Fix #MegaMek#1514: Fix Atrocious table shading render speed

MekHQ
+ PR MegaMek#4106: Use tabs in customize scenario dialog
+ PR MegaMek#4105: Updated Post-Scenario Logging for Prisoners
+ PR MegaMek#4104: Fixed Post-Scenario Tracking System's Handling of Multiple Personnel in autoAwards
+ PR MegaMek#4102: Fixed Award Tier Count Calculations in PersonViewPanel
+ PR MegaMek#4093: Added Negotiation and Scrounge Skill Settings for Administrator Personnel
+ PR MegaMek#4054: Added Life Paths Campaign Options Tab, Added Education Module
            Very Important to read the documentation on this feature (See Docs folder)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For New Dev Cycle This PR should be merged at the beginning of a dev cycle Refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants