Refactor containers and library loading

Replace trackPtr with raw Track* pointers in HashTable, add loadLibrary
to PlayerLocal, remove unused File helpers, and fix broken artwork/artist
SQL bindings.
This commit is contained in:
2026-06-22 11:51:27 +02:00
parent 05bd44a354
commit 00c8d9b843
6 changed files with 29 additions and 15 deletions
+4 -4
View File
@@ -108,7 +108,7 @@ std::ptrdiff_t ht::probe ( const std::string &key, uint64_t hash, bool insert )
#endif
} // probe
void ht::ht_insert( const std::string& key, trackPtr track ) {
void ht::ht_insert( const std::string& key, Track* t ) {
//double loadFactor = static_cast<double> ( size_ ) / static_cast<double> ( ctrl_.size());
if ( loadFactor_ > MAX_LOAD ) rehash( ctrl_.size() * 2 );
@@ -120,16 +120,16 @@ void ht::ht_insert( const std::string& key, trackPtr track ) {
Entry tmp;
tmp.key = key;
tmp.hash = hash;
tmp.track = track;
tmp.track = t;
entries_.at( idx ) = std::move( tmp );
++size_;
} else {
entries_.at( idx ).track = track;
entries_.at( idx ).track = t;
}
ctrl_.at( idx ) = fingerprint( hash );
}
trackPtr ht::ht_lookup( const std::string& key ) const {
Track* ht::ht_lookup( const std::string& key ) const {
uint64_t hash = hashString( key );
auto idx = probe( key, hash, false );
if ( idx != -1 ) return entries_.at( static_cast<std::size_t> ( idx )).track;