<commit_before>package org.frice.game.utils.misc

const val USHR = 6
const val MOD = 0b11_1111

class BoolArray(val length: Int) {
	val longs = LongArray((length ushr USHR) + 1)
	operator fun get(index: Int): Boolean {
		if (index >= length) throw IndexOutOfBoundsException("Index $index is out of range!(size: $length)")
		return longs[index ushr USHR] and (0b1L shl (index and MOD) - 1) != 0L
	}

	operator fun set(index: Int, boolean: Boolean) {
		if (index >= length) throw IndexOutOfBoundsException("Index $index is out of range!(size: $length)")
		if (boolean) longs[index ushr USHR] = longs[index ushr USHR] or (0b1L shl (index and MOD) - 1)
		else longs[index ushr USHR] = longs[index ushr USHR] and (0b1L shl (index and MOD) - 1).inv()
	}
}<commit_msg>add new constructor for bool array<commit_after>package org.frice.game.utils.misc

const val USHR = 6
const val MOD = 0b11_1111

class BoolArray(val longs: LongArray) {
	constructor(length: Int) : this(LongArray((length ushr USHR) + 1))

	val length = longs.size

	operator fun get(index: Int): Boolean {
		if (index >= length) throw IndexOutOfBoundsException("Index $index is out of range!(size: $length)")
		return longs[index ushr USHR] and (0b1L shl (index and MOD) - 1) != 0L
	}

	operator fun set(index: Int, boolean: Boolean) {
		if (index >= length) throw IndexOutOfBoundsException("Index $index is out of range!(size: $length)")
		if (boolean) longs[index ushr USHR] = longs[index ushr USHR] or (0b1L shl (index and MOD) - 1)
		else longs[index ushr USHR] = longs[index ushr USHR] and (0b1L shl (index and MOD) - 1).inv()
	}
}
{'fraction_non_alphanumeric': 0.12343358395989974, 'fraction_numerical': 0.023809523809523808, 'mean_word_length': 4.545138888888889, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2967985', 'n_tokens_mistral': 606, 'n_tokens_neox': 564, 'n_words': 196}