<commit_before>package slices

import "bytes"

// Return true if a slice contains 0 elements
// or if all elements in a slice have lengths of 0.
func IsEmpty(slc []string) bool {

	lenSlc := len(slc)
	for i := 0; i < lenSlc; i++ {
		if slc[i] != "" {
			return false
		}
	}
	return true
}

// Return true if the elements of both slices have equal values.
// In order for elements to equal each other,
//   they do NOT need to point to the same memory location;
//   they only need to hold an equal value.
func Equals(slc1 []string, slc2 []string) bool {

	lenSlc1 := len(slc1)
	lenSlc2 := len(slc2)

	if lenSlc1 != lenSlc2 {
		return false
	}

	iMax := lenSlc1
	for i := 0; i < iMax; i++ {
		if slc1[i] != slc2[i] {
			return false
		}
	}
	return true
}

// Return true if both slices point to the same array.
// Probably not useful.
func IsSameArray(slc1 []string, slc2 []string) bool {
	return &slc1 == &slc2
}

// Concatenate/Join all elements of a slice into a single string.
func Concat(slc []string) string {

	var b bytes.Buffer
	defer b.Reset()

	lenSlc := len(slc)
	for i := 0; i < lenSlc; i++ {
		b.WriteString(slc[i])
	}

	return b.String()
}

// Concatenate/Join all elements of a slice into a single string.
// Separate each element by a provided string.
func Join(slc []string, by string) string {<commit_msg>Fix IsSameArray()<commit_after>package slices

import "bytes"

// Return true if a slice contains 0 elements
// or if all elements in a slice have lengths of 0.
func IsEmpty(slc []string) bool {

	lenSlc := len(slc)
	for i := 0; i < lenSlc; i++ {
		if slc[i] != "" {
			return false
		}
	}
	return true
}

// Return true if the elements of both slices have equal values.
// In order for elements to equal each other,
//   they do NOT need to point to the same memory location;
//   they only need to hold an equal value.
func Equals(slc1 []string, slc2 []string) bool {

	lenSlc1 := len(slc1)
	lenSlc2 := len(slc2)

	if lenSlc1 != lenSlc2 {
		return false
	}

	iMax := lenSlc1
	for i := 0; i < iMax; i++ {
		if slc1[i] != slc2[i] {
			return false
		}
	}
	return true
}

// Return true if both slices point to the same array.
// Probably not useful.
func IsSameArray(slc1 []string, slc2 []string) bool {
	return &slc1 != &slc2
}

// Concatenate/Join all elements of a slice into a single string.
func Concat(slc []string) string {

	var b bytes.Buffer
	defer b.Reset()

	lenSlc := len(slc)
	for i := 0; i < lenSlc; i++ {
		b.WriteString(slc[i])
	}

	return b.String()
}

// Concatenate/Join all elements of a slice into a single string.
// Separate each element by a provided string.
func Join(slc []string, by string) string {
{'fraction_non_alphanumeric': 0.11849056603773585, 'fraction_numerical': 0.01509433962264151, 'mean_word_length': 3.1164596273291925, 'pattern_counts': {'":': 0, '<': 9, '<?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': '3887259', 'n_tokens_mistral': 1009, 'n_tokens_neox': 956, 'n_words': 369}