<commit_before>package drax

import (
	"sync"

	"github.com/boltdb/bolt"
	"github.com/hashicorp/raft"
)

type peerStoreWrapper struct {
	peerStore raft.PeerStore
}

func (p *peerStoreWrapper) SetPeers(peers []string) error {
	if err := p.peerStore.SetPeers(peers); err != nil {
		return err
	}
	return nil
}

func (p *peerStoreWrapper) Peers() ([]string, error) {
	return p.peerStore.Peers()
}

func newPeerStore(home string, transport raft.Transport) *peerStoreWrapper {
	return &peerStoreWrapper{
		raft.NewJSONPeers(home, transport),
	}
}

type peers struct {
	sync.Mutex
	peers  map[string]struct{}
	notify chan string
	db     *bolt.DB
}

func (s *peers) Peers() ([]string, error) {
	s.Lock()
	var peers []string
	for p := range s.peers {
		peers = append(peers, p)
	}
	s.Unlock()
	return peers, nil
}

func (s *peers) SetPeers(peers []string) error {
	s.Lock()
	s.peers = make(map[string]struct{})
	for _, p := range peers {
		s.peers[p] = struct{}{}
	}
	s.Unlock()
	return nil
}<commit_msg>remove unused peers struct<commit_after>package drax

import "github.com/hashicorp/raft"

type peerStoreWrapper struct {
	peerStore raft.PeerStore
}

func (p *peerStoreWrapper) SetPeers(peers []string) error {
	if err := p.peerStore.SetPeers(peers); err != nil {
		return err
	}
	return nil
}

func (p *peerStoreWrapper) Peers() ([]string, error) {
	return p.peerStore.Peers()
}

func newPeerStore(home string, transport raft.Transport) *peerStoreWrapper {
	return &peerStoreWrapper{
		raft.NewJSONPeers(home, transport),
	}
}
{'fraction_non_alphanumeric': 0.1366622864651774, 'fraction_numerical': 0.0, 'mean_word_length': 4.4784172661870505, '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': '6664147', 'n_tokens_mistral': 583, 'n_tokens_neox': 566, 'n_words': 139}