<commit_before>package main

import (
	//	"fmt"
	"github.com/jinzhu/gorm"
	_ "github.com/mattn/go-sqlite3"
	"log"
	"strconv"
)

func getChildren(mt *MeshTree, db *gorm.DB) ([]*MeshTree, error) {
	var mtChildren []*MeshTree
	if mt.Depth == 12 {
		return mtChildren, nil
	}
	q := getChildrenQuery(mt, false)

	log.Println("**************************", mt.Depth, q)

	db.Where(q).Find(&mtChildren)
	var count int64
	db.Model(&MeshTree{}).Where(q).Count(&count)
	log.Println(count)
	q = getChildrenQuery(mt, true)
	log.Println("******* all", q)
	db.Model(&MeshTree{}).Where(q).Count(&count)
	log.Println(count)
	return mtChildren, nil<commit_msg>Fixed unnecessary queries for getChildren<commit_after>package main

import (
	//	"fmt"
	"github.com/jinzhu/gorm"
	_ "github.com/mattn/go-sqlite3"
	"log"
	"strconv"
)

func getChildren(mt *MeshTree, db *gorm.DB) ([]*MeshTree, error) {
	var mtChildren []*MeshTree
	if mt.Depth == 12 {
		return mtChildren, nil
	}
	q := getChildrenQuery(mt, false)

	log.Println("**************************", mt.Depth, q)

	db.Where(q).Find(&mtChildren)
	// var count int64
	// db.Model(&MeshTree{}).Where(q).Count(&count)
	// log.Println(count)
	// q = getChildrenQuery(mt, true)
	// log.Println("******* all", q)
	// db.Model(&MeshTree{}).Where(q).Count(&count)
	// log.Println(count)
	return mtChildren, nil
{'fraction_non_alphanumeric': 0.22355588897224307, 'fraction_numerical': 0.007501875468867217, 'mean_word_length': 4.6525423728813555, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1702970', 'n_tokens_mistral': 535, 'n_tokens_neox': 518, 'n_words': 97}