Skip to content

Commit

Permalink
remove filter and first
Browse files Browse the repository at this point in the history
  • Loading branch information
vinceau committed Jan 25, 2024
1 parent 5cad03f commit 6381ad8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/broadcast/broadcast_manager.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Preconditions } from "@common/preconditions";
import { ConnectionEvent, ConnectionStatus, DolphinConnection, DolphinMessageType } from "@slippi/slippi-js";
import { EventEmitter } from "events";
import first from "lodash/first";
import keyBy from "lodash/keyBy";
import last from "lodash/last";
import type { connection, Message } from "websocket";
Expand Down Expand Up @@ -264,7 +263,7 @@ export class BroadcastManager extends EventEmitter {
}
const newFirstCursor = newFirstEvent.cursor;

const firstBackupCursor = (first(this.backupEvents) || {}).cursor;
const firstBackupCursor = (this.backupEvents[0] || {}).cursor;
const lastBackupCursor = (last(this.backupEvents) || {}).cursor;

this.emit(
Expand Down
3 changes: 1 addition & 2 deletions src/renderer/pages/replays/replay_file_stats/kill_table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Tooltip from "@mui/material/Tooltip";
import type { FileResult, PlayerInfo } from "@replays/types";
import type { StatsType, StockType } from "@slippi/slippi-js";
import { animations as animationUtils, Frames, moves as moveUtils } from "@slippi/slippi-js";
import filter from "lodash/filter";
import get from "lodash/get";
import groupBy from "lodash/groupBy";
import keyBy from "lodash/keyBy";
Expand Down Expand Up @@ -106,7 +105,7 @@ export const KillTable = ({ file, stats, player, opp, onPlay }: KillTableProps)
const playerPunishes = punishesByPlayer[opp.playerIndex] || [];

// Only get punishes that killed
const killingPunishes = filter(playerPunishes, "didKill");
const killingPunishes = playerPunishes.filter((punish) => punish.didKill);
const killingPunishesByEndFrame = keyBy(killingPunishes, "endFrame");
const punishThatEndedStock =
stock.endFrame !== null && stock.endFrame !== undefined ? killingPunishesByEndFrame[stock.endFrame] : null;
Expand Down

0 comments on commit 6381ad8

Please sign in to comment.