<commit_before>#include "StorageDatabase.h"
#include "StorageDataCache.h"
#include "System/FileSystem.h"

#include <stdio.h>

void StorageDatabase::Open(const char* dbName)
{
	name.Write(dbName);
	DCACHE->Init(DEFAULT_CACHE_SIZE);
}

StorageTable* StorageDatabase::GetTable(const char* tableName)
{
	StorageTable* it;
	
	for (it = tables.First(); it != NULL; it = tables.Next(it))
	{
		if (MEMCMP(it->GetName(), strlen(it->GetName()), tableName, strlen(tableName)))
			return it;
	}
	
	it = new StorageTable();
	it->Open(tableName);
	tables.Append(it);
	
	return it;
}

void StorageDatabase::CloseTable(const char* tableName)
{
	StorageTable* it;
	
	for (it = tables.First(); it != NULL; it = tables.Next(it))
	{
		if (it->GetName() == tableName)
		{
			it->Close();
			tables.Delete(it);
			return;
		}
	}
}

void StorageDatabase::Close()
{
	StorageTable* it;
	
	for (it = tables.First(); it != NULL; it = tables.Delete(it))
		it->Close();
	<commit_msg>Fixed string comparison in StorageDatabase.<commit_after>#include "StorageDatabase.h"
#include "StorageDataCache.h"
#include "System/FileSystem.h"

#include <stdio.h>

void StorageDatabase::Open(const char* dbName)
{
	name.Write(dbName);
	DCACHE->Init(DEFAULT_CACHE_SIZE);
}

StorageTable* StorageDatabase::GetTable(const char* tableName)
{
	StorageTable* it;
	
	for (it = tables.First(); it != NULL; it = tables.Next(it))
	{
		if (MEMCMP(it->GetName(), strlen(it->GetName()), tableName, strlen(tableName)))
			return it;
	}
	
	it = new StorageTable();
	it->Open(tableName);
	tables.Append(it);
	
	return it;
}

void StorageDatabase::CloseTable(const char* tableName)
{
	StorageTable* it;
	
	for (it = tables.First(); it != NULL; it = tables.Next(it))
	{
		if (strcmp(it->GetName(), tableName) == 0)
		{
			it->Close();
			tables.Delete(it);
			return;
		}
	}
}

void StorageDatabase::Close()
{
	StorageTable* it;
	
	for (it = tables.First(); it != NULL; it = tables.Delete(it))
		it->Close();
	
{'fraction_non_alphanumeric': 0.17342226782965622, 'fraction_numerical': 0.000513083632632119, 'mean_word_length': 4.587392550143266, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '6707653', 'n_tokens_mistral': 745, 'n_tokens_neox': 697, 'n_words': 149}