<commit_before>package main

type RoundRobin struct {
	pos int
	max int
	cur int
}

func (r *RoundRobin) SetMax(rp interface{}) {
	r.max = len(*rp.(*[]string))
}

func (r *RoundRobin) GetPos() int {
	r.cur = r.pos
	r.pos += 1
	if r.pos == (r.max) {
		r.pos = 0
	}
	log.Warning("Returning index: ", r.cur)
	return r.cur
}<commit_msg>Fixed possible dynamic round-robin LB issue<commit_after>package main

type RoundRobin struct {
	pos int
	max int
	cur int
}

func (r *RoundRobin) SetMax(rp interface{}) {
	r.max = len(*rp.(*[]string))

	// Can't have a new list substituted that's shorter
	if r.cur > r.max {
		r.cur = 0
	}
}

func (r *RoundRobin) GetPos() int {
	r.cur = r.pos
	r.pos += 1
	if r.pos == (r.max) {
		r.pos = 0
	}
	log.Debug("[ROUND ROBIN] Returning index: ", r.cur)
	return r.cur
}
{'fraction_non_alphanumeric': 0.1610062893081761, 'fraction_numerical': 0.006289308176100629, 'mean_word_length': 3.1894736842105265, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '454092', 'n_tokens_mistral': 346, 'n_tokens_neox': 331, 'n_words': 94}