<commit_before>package shell

func Sort(arr []int) {
	if arr == nil || len(arr) < 2 {
		return
	}

	h := 1
	//find proper increment sequence
	for h < len(arr)/3 {
		h = h*3 + 1
	}

	for h >= 1 {

		for i := h; i < len(arr); i++ {
			for j := i; j >= h; j -= h {
				if arr[j] < arr[j-h] {
					arr[j], arr[j-h] = arr[j-h], arr[j]
				}
			}
		}

		h = h / 3
	}

}<commit_msg>optimize shell_sort<commit_after>package shell

func Sort(arr []int) {
	if arr == nil || len(arr) < 2 {
		return
	}
	h := 1
	//find proper increment sequence
	for h < len(arr)/3 {
		h = h*3 + 1
	}
	for h >= 1 {
		for i := h; i < len(arr); i++ {
			for j := i; j >= h && arr[j] < arr[j-h]; j -= h {
				arr[j], arr[j-h] = arr[j-h], arr[j]
			}
		}
		h = h / 3
	}
}
{'fraction_non_alphanumeric': 0.2140921409214092, 'fraction_numerical': 0.018970189701897018, 'mean_word_length': 2.0040650406504064, 'pattern_counts': {'":': 0, '<': 11, '<?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': '3737055', 'n_tokens_mistral': 388, 'n_tokens_neox': 341, 'n_words': 98}