<commit_before>import {List, Map} from 'immutable';
import {v4} from 'node-uuid';

export function createGame() {
    return Map({players: Map({})});
}

export function createPlayer(name) {
    return {name, id: v4(), hand: List.of()};
}

export function addPlayerToGame(game, player) {
    const players = game.get('players').set(player.id, player);
    const newGame = game.set('players', players);
    return newGame;
}<commit_msg>Don't need intermediate "newGame". It harshes my mellow<commit_after>import {List, Map} from 'immutable';
import {v4} from 'node-uuid';

export function createGame() {
    return Map({players: Map({})});
}

export function createPlayer(name) {
    return {name, id: v4(), hand: List.of()};
}

export function addPlayerToGame(game, player) {
    const players = game.get('players').set(player.id, player);
    return game.set('players', players);;
}
{'fraction_non_alphanumeric': 0.16439909297052155, 'fraction_numerical': 0.0045351473922902496, 'mean_word_length': 4.926174496644295, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1242115', 'n_tokens_mistral': 288, 'n_tokens_neox': 287, 'n_words': 80}