<commit_before>package net.squanchy.search.view

import android.support.v7.widget.GridLayoutManager

import net.squanchy.search.view.SearchAdapter.ViewTypeId

internal class GridSpanSizeLookup(private val itemsAdapter: ItemsAdapter, private val columnCount: Int) : GridLayoutManager.SpanSizeLookup() {

    init {
        super.setSpanIndexCacheEnabled(true)
    }

    override fun getSpanSize(position: Int): Int {
        return if (itemsAdapter.isEmpty) SINGLE_COLUMN_SPAN_SIZE else getSpanSizeFor(itemsAdapter.viewTypeAtAbsolutePosition(position))
    }

    private fun getSpanSizeFor(@ViewTypeId viewTypeId: Int): Int =
        when (viewTypeId) {
            ViewTypeId.HEADER -> columnCount
            ViewTypeId.EVENT -> columnCount
            ViewTypeId.SPEAKER -> SINGLE_COLUMN_SPAN_SIZE
            else -> error("Invalid ViewTypeId $viewTypeId")
        }

    companion object {
        private const val SINGLE_COLUMN_SPAN_SIZE = 1
    }
}
<commit_msg>fix an import<commit_after>package net.squanchy.search.view

import android.support.v7.widget.GridLayoutManager
import net.squanchy.search.view.SearchAdapter.Companion.ViewTypeId

internal class GridSpanSizeLookup(private val itemsAdapter: ItemsAdapter, private val columnCount: Int) : GridLayoutManager.SpanSizeLookup() {

    init {
        super.setSpanIndexCacheEnabled(true)
    }

    override fun getSpanSize(position: Int): Int {
        return if (itemsAdapter.isEmpty) SINGLE_COLUMN_SPAN_SIZE else getSpanSizeFor(itemsAdapter.viewTypeAtAbsolutePosition(position))
    }

    private fun getSpanSizeFor(@ViewTypeId viewTypeId: Int): Int =
        when (viewTypeId) {
            SearchAdapter.HEADER -> columnCount
            SearchAdapter.EVENT -> columnCount
            SearchAdapter.SPEAKER -> SINGLE_COLUMN_SPAN_SIZE
            else -> error("Invalid ViewTypeId $viewTypeId")
        }

    companion object {
        private const val SINGLE_COLUMN_SPAN_SIZE = 1
    }
}

{'fraction_non_alphanumeric': 0.07609805924412666, 'fraction_numerical': 0.0020429009193054137, 'mean_word_length': 3.4624145785876994, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '3315052', 'n_tokens_mistral': 573, 'n_tokens_neox': 563, 'n_words': 112}