Tweaks to for loops

This commit is contained in:
EliteMasterEric
2026-04-06 04:18:10 -06:00
committed by Hundrec
parent 9f695a28f5
commit d344741f85
40 changed files with 108 additions and 155 deletions
+12 -2
View File
@@ -341,9 +341,14 @@ class FunkinMemory
}
var sound:Null<Sound> = Assets.getSound(key, true);
if (sound == null) return;
if (sound == null)
{
return;
}
else
{
currentCachedSounds.set(key, sound);
}
}
/**
@@ -355,9 +360,14 @@ class FunkinMemory
if (permanentCachedSounds.exists(key)) return;
var sound:Null<Sound> = Assets.getSound(key, true);
if (sound == null) return;
if (sound == null)
{
return;
}
else
{
permanentCachedSounds.set(key, sound);
}
if (sound != null) currentCachedSounds.set(key, sound);
}
+1 -2
View File
@@ -122,8 +122,7 @@ class Medals
if (parser.errors.length > 0)
{
trace(' NEWGROUNDS '.bold().bg_orange() + ' Failed to parse local medal data!');
for (error in parser.errors)
funkin.data.DataError.printError(error);
for (error in parser.errors) funkin.data.DataError.printError(error);
medalJSON = [];
}
else
@@ -190,8 +190,7 @@ class SpectogramSprite extends FlxTypedSpriteGroup<FlxSprite>
var freqPower:Float = 0;
for (pow in 0...freqShit.length)
freqPower += freqShit[pow][remappedFreq];
for (pow in 0...freqShit.length) freqPower += freqShit[pow][remappedFreq];
freqPower /= freqShit.length;
var freqIDK:Float = FlxMath.remapToRange(freqPower, 0, 0.000005, 0, 50);
+1 -2
View File
@@ -65,8 +65,7 @@ class VisShit
{
// take a chunk (zero-padded if needed) and apply the window
final chunk = [
for (n in 0...fftN)
(c + n < samples.length ? samples[c + n] : 0.0) * window(n)
for (n in 0...fftN) (c + n < samples.length ? samples[c + n] : 0.0) * window(n)
];
// compute positive spectrum with sampling correction and BP filter
+6 -12
View File
@@ -48,8 +48,7 @@ class FFT
{
final n = nextPow2(input.length);
var ts = [
for (i in 0...n)
if (i < input.length) input[i] else Complex.zero
for (i in 0...n) if (i < input.length) input[i] else Complex.zero
];
var fs = [for (_ in 0...n) Complex.zero];
ditfft2(ts, 0, fs, 0, n, 1, inverse);
@@ -127,22 +126,19 @@ class FFT
// build a time signal as a sum of sinusoids
final freqs = [5919.911];
final ts = [
for (n in 0...N)
freqs.map(f -> Math.sin(2 * Math.PI * f * n / Fs)).sum()
for (n in 0...N) freqs.map(f -> Math.sin(2 * Math.PI * f * n / Fs)).sum()
];
// get positive spectrum and use its symmetry to reconstruct negative domain
final fs_pos = rfft(ts);
final fs_fft = new OffsetArray([
for (k in -(halfN - 1)...0)
fs_pos[-k].conj()
for (k in -(halfN - 1)...0) fs_pos[-k].conj()
].concat(fs_pos), -(halfN - 1));
// double-check with naive DFT
final fs_dft = new OffsetArray(dft(ts.map(Complex.fromReal)).circShift(halfN - 1), -(halfN - 1));
final fs_err = [
for (k in -(halfN - 1)...halfN)
fs_fft[k] - fs_dft[k]
for (k in -(halfN - 1)...halfN) fs_fft[k] - fs_dft[k]
];
final max_fs_err = fs_err.map(z -> z.magnitude).max();
if (max_fs_err > 1e-6) haxe.Log.trace('FT Error: ${max_fs_err}', null);
@@ -160,8 +156,7 @@ class FFT
else
{
final freqs_err = [
for (i in 0...freqs.length)
freqis[i] - freqs[i]
for (i in 0...freqs.length) freqis[i] - freqs[i]
];
final max_freqs_err = freqs_err.map(Math.abs).max();
if (max_freqs_err > Fs / N) trace('Frequency Errors: ${freqs_err}');
@@ -170,8 +165,7 @@ class FFT
// recover time signal from the frequency domain
final ts_ifft = ifft(fs_fft.array.circShift(-(halfN - 1)).map(z -> z.scale(1 / Fs)));
final ts_err = [
for (n in 0...N)
ts_ifft[n].scale(Fs).real - ts[n]
for (n in 0...N) ts_ifft[n].scale(Fs).real - ts[n]
];
final max_ts_err = ts_err.map(Math.abs).max();
if (max_ts_err > 1e-6) haxe.Log.trace('IFT Error: ${max_ts_err}', null);
+1 -2
View File
@@ -48,8 +48,7 @@ class Signal
var peaks = new Array<Int>();
final dy = [
for (i in 1...y.length)
y[i] - y[i - 1]
for (i in 1...y.length) y[i] - y[i - 1]
];
for (i in 1...dy.length)
{
@@ -132,6 +132,8 @@ class WaveformDataParser
trace('[WAVEFORM] Failed to parse waveform data: ${id}');
for (error in errors)
{
funkin.data.DataError.printError(error);
}
}
}
+7 -7
View File
@@ -224,9 +224,11 @@ class DataParse
*/
static function jsonArrayToDynamicArray(jsons:Array<Json>):Array<Null<Dynamic>>
{
return [
return[
for (json in jsons)
{
Tools.getValue(json)
}
];
}
@@ -235,9 +237,8 @@ class DataParse
switch (json.value)
{
case JArray(values):
return [
for (value in values)
legacyNoteSection(value, name)
return[
for (value in values) legacyNoteSection(value, name)
];
default:
throw 'Expected property to be an array, but it was ${json.value}.';
@@ -299,9 +300,8 @@ class DataParse
switch (json.value)
{
case JArray(values):
return [
for (value in values)
legacyNote(value, name)
return[
for (value in values) legacyNote(value, name)
];
default:
throw 'Expected property $name to be an array of notes, but it was ${json.value}.';
+2 -4
View File
@@ -34,8 +34,7 @@ class SongDataUtils
};
var result = [
for (i in 0...notes.length)
offsetNote(notes[i])
for (i in 0...notes.length) offsetNote(notes[i])
];
return result;
}
@@ -304,8 +303,7 @@ class SongDataUtils
if (parser.errors.length > 0)
{
trace('[SongDataUtils] Error parsing note JSON data from clipboard.');
for (error in parser.errors)
DataError.printError(error);
for (error in parser.errors) DataError.printError(error);
return {
valid: false,
notes: [],
@@ -88,8 +88,7 @@ class ChartManifestData
{
trace('[ChartManifest] Failed to parse chart file manifest');
for (error in parser.errors)
DataError.printError(error);
for (error in parser.errors) DataError.printError(error);
return null;
}
@@ -21,8 +21,7 @@ class FNFLegacyImporter
if (parser.errors.length > 0)
{
trace('[FNFLegacyImporter] Error parsing JSON data from ' + fileName + ':');
for (error in parser.errors)
DataError.printError(error);
for (error in parser.errors) DataError.printError(error);
return null;
}
return parser.value;
@@ -276,8 +276,7 @@ class StepManiaImporter
var tps = parseTimingPointLine(line);
if (tps != null)
{
for (tp in tps)
result.TimingPoints.push(tp);
for (tp in tps) result.TimingPoints.push(tp);
}
return result;
}
@@ -287,8 +286,7 @@ class StepManiaImporter
var sps = parseStopsLine(line);
if (sps != null)
{
for (sp in sps)
result.Stops.push(sp);
for (sp in sps) result.Stops.push(sp);
}
return result;
}
@@ -416,8 +414,7 @@ class StepManiaImporter
{
// end of measure
var stepNotesInMeasure = parseMeasure(measure, currentMeasure);
for (stepNote in stepNotesInMeasure)
workingDiff.notes.push(stepNote);
for (stepNote in stepNotesInMeasure) workingDiff.notes.push(stepNote);
measure = [];
currentMeasure++;
// end of StepNotes section
@@ -133,12 +133,11 @@ class RuntimeRainShader extends RuntimePostEffectShader
if (storageType == 'uniform')
{
lights = [
for (i in 0...MAX_LIGHTS)
{
position: addFloatUniform('lights[$i].position', 2),
color: addFloatUniform('lights[$i].color', 3),
radius: addFloatUniform('lights[$i].radius', 1),
}
for (i in 0...MAX_LIGHTS) {
position: addFloatUniform('lights[$i].position', 2),
color: addFloatUniform('lights[$i].color', 3),
radius: addFloatUniform('lights[$i].radius', 1),
}
];
}
}
+2 -4
View File
@@ -844,8 +844,7 @@ class Controls extends FlxActionSet
{
case null:
// add all
for (gamepad in controls.gamepadsAdded)
if (gamepadsAdded.indexOf(gamepad) == -1) gamepadsAdded.push(gamepad);
for (gamepad in controls.gamepadsAdded) if (gamepadsAdded.indexOf(gamepad) == -1) gamepadsAdded.push(gamepad);
mergeKeyboardScheme(controls.keyboardScheme);
@@ -1195,8 +1194,7 @@ class Controls extends FlxActionSet
{
gamepadsAdded.push(id);
for (control in buttonMap.keys())
bindButtons(control, id, buttonMap[control]);
for (control in buttonMap.keys()) bindButtons(control, id, buttonMap[control]);
}
public function removeGamepad(deviceID:Int = FlxInputDeviceID.ALL):Void
+1 -2
View File
@@ -599,8 +599,7 @@ class PolymodHandler
public static function getAllModDirs():Array<String>
{
var modDirs:Array<String> = [
for (i in getAllMods())
i.dirName
for (i in getAllMods()) i.dirName
];
return modDirs;
}
+1 -2
View File
@@ -3015,8 +3015,7 @@ class PlayState extends MusicBeatSubState
var notesByDirection:Array<Array<NoteSprite>> = [[], [], [], []];
for (note in notesInRange)
notesByDirection[note.direction].push(note);
for (note in notesInRange) notesByDirection[note.direction].push(note);
while (inputPressQueue.length > 0)
{
@@ -85,8 +85,7 @@ class TallyNumber extends FlxSprite
frames = Paths.getSparrowAtlas("resultScreen/tallieNumber");
for (i in 0...10)
animation.addByPrefix(Std.string(i), i + " small", 24, false);
for (i in 0...10) animation.addByPrefix(Std.string(i), i + " small", 24, false);
animation.play(Std.string(digit));
updateHitbox();
+19 -23
View File
@@ -27,18 +27,17 @@ class SongEventHelper
public static function generateEaseGraphsBitmaps():Void
{
for (ease in easeDirList)
for (dir in easeDirs)
for (ease in easeDirList) for (dir in easeDirs)
{
final func = getEaseFunc(ease, dir);
if (func == null) continue;
final key = ease + dir;
if (!easeBitmapMap.exists(key))
{
final func = getEaseFunc(ease, dir);
if (func == null) continue;
final key = ease + dir;
if (!easeBitmapMap.exists(key))
{
final bd = createBitmapFromFunc(func, key);
if (bd != null) easeBitmapMap.set(key, bd);
}
final bd = createBitmapFromFunc(func, key);
if (bd != null) easeBitmapMap.set(key, bd);
}
}
var k = "INSTANT";
if (!easeBitmapMap.exists(k))
{
@@ -137,17 +136,15 @@ class SongEventHelper
var y:Int = getEaseY(raw, size, range);
if (lastY == -1)
{
for (xx in (i - half)...(i + half + 1))
if (xx >= 0 && xx < size) for (yy in (y - half)...(y + half + 1))
if (yy >= 0 && yy < size) bd.setPixel32(xx, yy, 0xFFFFFFFF);
for (xx in (i - half)...(i + half + 1)) if (xx >= 0 && xx < size) for (yy in (y - half)...(y + half + 1)) if (yy >= 0 && yy < size)
bd.setPixel32(xx, yy, 0xFFFFFFFF);
}
else
{
var a = Std.int(Math.min(y, lastY));
var b = Std.int(Math.max(y, lastY));
for (xx in (i - half)...(i + half + 1))
if (xx >= 0 && xx < size) for (yy in a - half...b + half + 1)
if (yy >= 0 && yy < size) bd.setPixel32(xx, yy, 0xFFFFFFFF);
for (xx in (i - half)...(i + half + 1)) if (xx >= 0 && xx < size) for (yy in a - half...b + half + 1) if (yy >= 0 && yy < size) bd.setPixel32(xx,
yy, 0xFFFFFFFF);
}
lastY = y;
}
@@ -204,13 +201,12 @@ class SongEventHelper
var y:Int = getEaseY(raw, sizeH, range);
var bd:BitmapData = new BitmapData(dotWidth, sizeH, false, 0xFF202223);
var centerX:Int = Std.int(dotWidth / 2);
for (dx in -dotRadius...dotRadius + 1)
for (dy in -dotRadius...dotRadius + 1)
{
var px = centerX + dx;
var py = y + dy;
if (px >= 0 && px < dotWidth && py >= 0 && py < sizeH) if (dx * dx + dy * dy <= dotRadius * dotRadius) bd.setPixel32(px, py, 0xFFFFFFFF);
}
for (dx in -dotRadius...dotRadius + 1) for (dy in -dotRadius...dotRadius + 1)
{
var px = centerX + dx;
var py = y + dy;
if (px >= 0 && px < dotWidth && py >= 0 && py < sizeH) if (dx * dx + dy * dy <= dotRadius * dotRadius) bd.setPixel32(px, py, 0xFFFFFFFF);
}
var gfxName = "ease_dot_" + key + "_" + f;
var gfx = FlxG.bitmap.add(bd, true, gfxName);
var spr = new FlxSprite();
@@ -955,8 +955,7 @@ class NoteStyle implements IRegistryEntry<NoteStyleData>
var animData:Null<Array<AnimationData>> = fetchSplashAnimationData(dir);
if (animData != null)
{
for (anim in animData)
FlxAnimationUtil.addAtlasAnimation(target, anim);
for (anim in animData) FlxAnimationUtil.addAtlasAnimation(target, anim);
}
};
@@ -132,8 +132,7 @@ class CreditsDataHandler
{
trace('[CREDITS] Failed to parse credits data: ${id}');
for (error in errors)
funkin.data.DataError.printError(error);
for (error in errors) funkin.data.DataError.printError(error);
}
#end
}
@@ -1381,8 +1381,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
function get_availableVariations():Array<String>
{
var variations:Array<String> = [
for (x in songMetadata.keys())
x
for (x in songMetadata.keys()) x
];
variations.sort(SortUtil.defaultThenAlphabetically.bind('default'));
return variations;
@@ -1417,8 +1416,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
{
var m:Null<SongMetadata> = songMetadata.get(x);
[
for (diff in (m?.playData?.difficulties ?? []))
'$diff-$x'
for (diff in (m?.playData?.difficulties ?? [])) '$diff-$x'
];
}
];
@@ -1485,8 +1483,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
{
// Add the chartdata difficulties to the metadata difficulties if they don't exist so that the editor properly loads them
var keys:Array<String> = [
for (x in songChartData.get(selectedVariation).notes.keys())
x
for (x in songChartData.get(selectedVariation).notes.keys()) x
];
for (key in keys)
{
@@ -2639,8 +2636,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
// Can't use filter() because of null safety checking!
var filteredWorkingFilePaths:Array<String> = [];
for (chartPath in previousWorkingFilePaths)
if (chartPath != null) filteredWorkingFilePaths.push(chartPath);
for (chartPath in previousWorkingFilePaths) if (chartPath != null) filteredWorkingFilePaths.push(chartPath);
save.chartEditorPreviousFiles.value = filteredWorkingFilePaths;
if (hasBackup) trace('Queuing backup prompt for next time!');
@@ -4924,8 +4920,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
var columnStart:Int = Std.int(Math.min(cursorColumnBase, cursorColumnBaseStart));
var columnEnd:Int = Std.int(Math.max(cursorColumnBase, cursorColumnBaseStart));
var columns:Array<Int> = [
for (i in columnStart...(columnEnd + 1))
i
for (i in columnStart...(columnEnd + 1)) i
].map(function(i:Int):Int
{
if (i >= eventColumn)
@@ -20,8 +20,7 @@ class MoveEventsCommand implements ChartEditorCommand
{
// Clone the events to prevent editing from affecting the history.
this.events = [
for (event in events)
event.clone()
for (event in events) event.clone()
];
if (offsetInSteps) this.offset = Conductor.instance.getStepTimeInMs(offset);
else
@@ -20,8 +20,7 @@ class MoveNotesCommand implements ChartEditorCommand
{
// Clone the notes to prevent editing from affecting the history.
this.notes = [
for (note in notes)
note.clone()
for (note in notes) note.clone()
];
if (offsetInSteps) this.offset = Conductor.instance.getStepTimeInMs(offset);
else
@@ -156,8 +156,7 @@ class CoolStatsGraph extends Sprite
public function average():Float
{
var sum:Float = 0;
for (value in history)
sum += value;
for (value in history) sum += value;
return sum / history.length;
}
@@ -536,8 +536,7 @@ class StageEditorState extends UIState
{
if (conductorInUse.currentBeat % 2 == 0)
{
for (char in getCharacters())
char?.dance(true);
for (char in getCharacters()) char?.dance(true);
}
for (asset in spriteArray)
@@ -812,8 +811,7 @@ class StageEditorState extends UIState
camMarker.visible = moveMode == "chars";
for (item in sprDependant)
item.disabled = (moveMode != "assets" || selectedSprite == null);
for (item in sprDependant) item.disabled = (moveMode != "assets" || selectedSprite == null);
menubarItemPaste.disabled = copiedSprite == null;
menubarItemFindObj.disabled = !(moveMode == "assets");
@@ -1198,14 +1196,12 @@ class StageEditorState extends UIState
menubarItemViewFloorLines.onChange = function(_)
{
for (awesome in floorLines)
awesome.visible = menubarItemViewFloorLines.selected;
for (awesome in floorLines) awesome.visible = menubarItemViewFloorLines.selected;
}
menubarItemViewPosMarkers.onChange = function(_)
{
for (coolbeans in posCircles)
coolbeans.visible = menubarItemViewPosMarkers.selected;
for (coolbeans in posCircles) coolbeans.visible = menubarItemViewPosMarkers.selected;
}
sprDependant = [menubarItemCopy, menubarItemCut, menubarItemDelete, menubarItemSelectNone];
@@ -1214,8 +1210,7 @@ class StageEditorState extends UIState
function reloadRecentFiles():Void
{
for (a in menubarItemOpenRecent.childComponents)
menubarItemOpenRecent.removeComponent(a);
for (a in menubarItemOpenRecent.childComponents) menubarItemOpenRecent.removeComponent(a);
for (file in Save.instance.stageEditorPreviousFiles.value)
{
@@ -40,8 +40,7 @@ class NewObjDialog extends Dialog
if (button == '{{Create}}')
{
var objNames = [
for (obj in StageEditorState.instance.spriteArray)
obj.name
for (obj in StageEditorState.instance.spriteArray) obj.name
];
if (field.text == '' || field.text == null || objNames.contains(field.text))
@@ -144,9 +144,8 @@ class StageEditorObjectAnimsToolbox extends StageEditorDefaultToolbox
// Otherwise, update them accordingly.
if (previousFrames != [
for (f in linkedObj.frames.frames)
f.name
if (previousFrames !=[
for (f in linkedObj.frames.frames) f.name
]) updateFrameList();
if (previousAnims != linkedObj.animation.getNameList().copy()) updateAnimList();
}
@@ -195,8 +194,7 @@ class StageEditorObjectAnimsToolbox extends StageEditorDefaultToolbox
{
var splitter = objAnimIndices.text.replace(" ", "").split(",");
for (num in splitter)
indices.push(Std.parseInt(num));
for (num in splitter) indices.push(Std.parseInt(num));
}
var shouldDoIndices:Bool = (indices.length > 0 && !indices.contains(null));
+1 -2
View File
@@ -39,8 +39,7 @@ class DifficultyStars extends FlxSpriteGroup
stars.shader = hsvShader;
for (memb in flames.members)
memb.shader = hsvShader;
for (memb in flames.members) memb.shader = hsvShader;
}
override function update(elapsed:Float):Void
+1 -2
View File
@@ -1612,8 +1612,7 @@ class FreeplayState extends MusicBeatSubState
{
fromCharSelect = false;
for (capsule in grpCapsules.members)
capsule.doLerp = true;
for (capsule in grpCapsules.members) capsule.doLerp = true;
}
});
}
+1 -2
View File
@@ -220,8 +220,7 @@ class LetterSort extends FlxSpriteGroup
if (curSelection < 0) curSelection = letters[0].regexLetters.length - 1;
if (curSelection >= letters[0].regexLetters.length) curSelection = 0;
for (letter in letters)
letter.changeLetter(diff, curSelection);
for (letter in letters) letter.changeLetter(diff, curSelection);
if (changeSelectionCallback != null) changeSelectionCallback(letters[2].regexLetters[letters[2].curLetter]); // bullshit and long lol!
}
@@ -40,7 +40,9 @@ class MultiSparrowFreeplayDJ extends BaseFreeplayDJ
var assetList = [];
for (anim in playableCharData.getAnimationsList())
{
if (anim.assetPath != null && !assetList.contains(anim.assetPath)) assetList.push(anim.assetPath);
}
var texture:FlxAtlasFrames = Paths.getSparrowAtlas(playableCharData.getAssetPath());
+2 -4
View File
@@ -171,8 +171,7 @@ class ControlsMenu extends Page<OptionsState.OptionsMenuPageName>
var formatName = name.replace('_', ' ');
var label = labels.add(new AtlasText(Math.max(FullScreenScaleMode.gameNotchSize.x, CONTROL_BASE_X), y, formatName, AtlasFont.BOLD));
label.alpha = 0.6;
for (i in 0...COLUMNS)
createItem(label.x + CONTROL_MARGIN_X + i * CONTROL_SPACING_X, y, control, i);
for (i in 0...COLUMNS) createItem(label.x + CONTROL_MARGIN_X + i * CONTROL_SPACING_X, y, control, i);
y += spacer;
}
@@ -284,8 +283,7 @@ class ControlsMenu extends Page<OptionsState.OptionsMenuPageName>
{
currentDevice = device;
for (item in controlGrid.members)
item.updateDevice(currentDevice);
for (item in controlGrid.members) item.updateDevice(currentDevice);
var cancel = device == Keys ? "Escape" : "Back";
// todo: alignment
+1 -2
View File
@@ -144,8 +144,7 @@ class FunkinSoundTray extends FlxSoundTray
{
var globalVolume:Int = FlxG.sound.muted || FlxG.sound.volume == 0 ? 0 : Math.round(FlxG.sound.logToLinear(FlxG.sound.volume) * 10);
for (i in 0..._bars.length)
_bars[i].visible = i < globalVolume;
for (i in 0..._bars.length) _bars[i].visible = i < globalVolume;
}
function saveVolumePreferences():Void
+1 -2
View File
@@ -857,8 +857,7 @@ class OffsetMenu extends Page<OptionsState.OptionsMenuPageName>
var notesByDirection:Array<Array<NoteSprite>> = [[], [], [], []];
for (note in notesInRange)
notesByDirection[note.direction].push(note);
for (note in notesInRange) notesByDirection[note.direction].push(note);
while (inputPressQueue.length > 0)
{
@@ -847,15 +847,13 @@ class FunkinPreloader extends FlxBasePreloader
// Render progress bar
var piecesToRender:Int = Std.int(percent * progressBarPieces.length);
for (i => piece in progressBarPieces)
piece.alpha = i <= piecesToRender ? 0.9 : 0.1;
for (i => piece in progressBarPieces) piece.alpha = i <= piecesToRender ? 0.9 : 0.1;
}
// Cycle ellipsis count to show loading
var ellipsisCount:Int = Std.int(elapsed / ELLIPSIS_TIME) % 3 + 1;
var ellipsis:String = '';
for (_ in 0...ellipsisCount)
ellipsis += '.';
for (_ in 0...ellipsisCount) ellipsis += '.';
// Render status text
updateProgressLeftText(currentState.getProgressLeftText(TOTAL_STEPS, ellipsis));
@@ -933,8 +931,7 @@ class FunkinPreloader extends FlxBasePreloader
rTextGroup.alpha = alphaToFade;
progressLines.alpha = alphaToFade;
for (piece in progressBarPieces)
piece.alpha = alphaToFade;
for (piece in progressBarPieces) piece.alpha = alphaToFade;
return elapsedFinished;
}
@@ -108,8 +108,7 @@ class StickerSubState extends MusicBeatSubState
}
if (params.oldStickers != null)
{
for (sticker in params.oldStickers)
grpStickers.add(sticker);
for (sticker in params.oldStickers) grpStickers.add(sticker);
degenStickers();
}
else
+2 -4
View File
@@ -100,8 +100,7 @@ class AnsiTrace
}
var pstr:String = infos.fileName + ":" + '${infos.lineNumber}'.bold();
if (infos.customParams != null) for (v in infos.customParams)
str += ", " + Std.string(v);
if (infos.customParams != null) for (v in infos.customParams) str += ", " + Std.string(v);
var header:String = "";
var body:String = str;
@@ -124,8 +123,7 @@ class AnsiTrace
#if (sys && debug)
if (AnsiUtil.isColorCodesSupported())
{
for (line in ansiBF)
Sys.stdout().writeString(line + "\n");
for (line in ansiBF) Sys.stdout().writeString(line + "\n");
Sys.stdout().flush();
}
#end
+3 -4
View File
@@ -41,7 +41,7 @@ class ArrayTools
*/
public static function clone<T>(array:Array<T>):Array<T>
{
return [for (element in array) element];
return[for (element in array) element];
}
/**
@@ -53,9 +53,8 @@ class ArrayTools
*/
public static function deepClone<T, U:ICloneable<T>>(array:Array<U>):Array<T>
{
return [
for (element in array)
element.clone()
return[
for (element in array) element.clone()
];
}
+3 -5
View File
@@ -12,7 +12,7 @@ class IteratorTools
{
public static function array<T>(iterator:Iterator<T>):Array<T>
{
return [for (i in iterator) i];
return[for (i in iterator) i];
}
public static function count<T>(iterator:Iterator<T>, ?predicate:(item:T) -> Bool):Int
@@ -21,13 +21,11 @@ class IteratorTools
if (predicate == null)
{
for (_ in iterator)
n++;
for (_ in iterator) n++;
}
else
{
for (x in iterator)
if (predicate(x)) n++;
for (x in iterator) if (predicate(x)) n++;
}
return n;
+1 -1
View File
@@ -25,7 +25,7 @@ class MapTools
public static function values<K, T>(map:Null<Map<K, T>>):Array<T>
{
if (map == null) return [];
return [for (i in map.iterator()) i];
return[for (i in map.iterator()) i];
}
/**