In a previous random cleanup commit, these optional arguments were left, but were ment to be removed afterwards when all occurrences were removed. Removing all those in this patch.
Details
- Reviewers
elexis - Commits
- rP19464: Remove optional arguments from randFloat, since the function can be called from…
- Trac Tickets
- #4326
load changed rms in Atlas
See that the code is logical equivalent
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
binaries/data/mods/public/maps/random/deep_forest.js | ||
---|---|---|
163 ↗ | (On Diff #1434) | Didn't inline this and below to avoid inconsistency throughout the file. |
binaries/data/mods/public/globalscripts/random.js | ||
---|---|---|
30 ↗ | (On Diff #1434) | Remove this part of the comment too if you remove the default parameters. |
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
http://jw:8080/job/phabricator/866/ for more details.
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
http://jw:8080/job/phabricator/867/ for more details.
Wasn't really convinced to remove the 0, 1 but since that function is used in the simulation, might be better off having users of the function specify a value.
(Would like to keep the randBool(0,5) if you don't mind though, since I don't see how the meaning of the arguments would ever change and 0.5 will be the vast majority of calls)
binaries/data/mods/public/maps/random/ardennes_forest.js | ||
---|---|---|
124 ↗ | (On Diff #1435) | ✓ seems more readable indeed |
binaries/data/mods/public/maps/random/caledonian_meadows.js | ||
167 ↗ | (On Diff #1435) | ✓ that is nicer to read |
312 ↗ | (On Diff #1435) | ✓ that is nicer to read as well |
359 ↗ | (On Diff #1435) | ✓ |
385 ↗ | (On Diff #1435) | ✓ |
737 ↗ | (On Diff #1435) | ✓ (since we wanted to get rid of TWO_PI) |
binaries/data/mods/public/maps/random/corsica.js | ||
184 ↗ | (On Diff #1435) | ✓ oh yes, that seems better, no need to compute the values. was wondering whether that 17 had some meaning, but I can't find anything, appears to be an experimental/artistic value, just like all the other RMS values. 0.49 + 1/17 is 0,548823529, so the error 0,1176471% |
336 ↗ | (On Diff #1435) | ✓ |
binaries/data/mods/public/maps/random/cycladic_archipelago.js | ||
105 ↗ | (On Diff #1435) | ✓ |
249 ↗ | (On Diff #1435) | ✓ since startAngle was declared above |
257 ↗ | (On Diff #1435) | meh, if we have to |
binaries/data/mods/public/maps/random/deep_forest.js | ||
163 ↗ | (On Diff #1434) | ✓ notice -1 can now be a result and 0 can't be a result anymore, but that is neglible since the likelihood of these numbers appearing is about zero |
201 ↗ | (On Diff #1435) | ✓ |
211 ↗ | (On Diff #1435) | ✓ |
234 ↗ | (On Diff #1435) | ✓ |
240 ↗ | (On Diff #1435) | ✓ |
binaries/data/mods/public/maps/random/latium.js | ||
97 ↗ | (On Diff #1435) | Some could make this 0.01 a const, so this is making the existing code easier to read but less nice to manipulate. |
102 ↗ | (On Diff #1435) | and reused here |
binaries/data/mods/public/maps/random/new_rms_test.js | ||
34 ↗ | (On Diff #1435) | ✓ |
binaries/data/mods/public/maps/random/rmgen/library.js | ||
129 ↗ | (On Diff #1435) | ✓ |
binaries/data/mods/public/maps/random/rmgen/misc.js | ||
778 ↗ | (On Diff #1435) | ✓ |
binaries/data/mods/public/maps/random/rmgen/noise.js | ||
35 ↗ | (On Diff #1435) | ✓ |
93 ↗ | (On Diff #1435) | ✓ yep, that looks much nicer |
binaries/data/mods/public/maps/random/rmgen/placer.js | ||
51 ↗ | (On Diff #1435) | ✓ yes nice |
binaries/data/mods/public/maps/random/rmgen/terrain.js | ||
45 ↗ | (On Diff #1435) | ✓ |
binaries/data/mods/public/maps/random/rmgen/utilityfunctions.js | ||
217 ↗ | (On Diff #1435) | ✓ inlining only and using Math.foo |
binaries/data/mods/public/maps/random/schwarzwald.js | ||
437 ↗ | (On Diff #1435) | ✓ |
binaries/data/mods/public/maps/random/rmgen/library.js | ||
---|---|---|
129 ↗ | (On Diff #1435) | Something like "uniformly distributed on the disk". |
Also complete since no calls to randFloat() are remaining. Tested only corsica vs sardinia and didn't notice any difference for that 0,1% percent change, the other changes are trivially correct.
binaries/data/mods/public/maps/random/rmgen/library.js | ||
---|---|---|
129 ↗ | (On Diff #1435) | k Also our favorite AE/BE distinction again:
https://en.wikipedia.org/wiki/Spelling_of_disc So disk it'S going to be |