]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Rename mmap_span -> mmap-span
authorMatt Joiner <anacrolix@gmail.com>
Mon, 23 Jun 2025 06:04:46 +0000 (16:04 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 23 Jun 2025 06:06:20 +0000 (16:06 +1000)
Go's magic treatment of _suffix is not a good naming convention.

mmap-span/mmap-span.go [moved from mmap_span/mmap_span.go with 99% similarity]
storage/mmap.go

similarity index 99%
rename from mmap_span/mmap_span.go
rename to mmap-span/mmap-span.go
index 10bbfb67632ee5ddadbedeabbee35e7766897bcf..55031040b7f863aeddda843bb323bb19ebf51803 100644 (file)
@@ -1,4 +1,4 @@
-package mmap_span
+package mmapSpan
 
 import (
        "errors"
index 5c84f28299319467ab2d271139c881fbb3769743..9587927608739af7fee6d7533a680ded145357be 100644 (file)
@@ -15,7 +15,7 @@ import (
        "github.com/edsrzf/mmap-go"
 
        "github.com/anacrolix/torrent/metainfo"
-       "github.com/anacrolix/torrent/mmap_span"
+       mmapSpan "github.com/anacrolix/torrent/mmap-span"
 )
 
 type mmapClientImpl struct {
@@ -55,7 +55,7 @@ func (s *mmapClientImpl) Close() error {
 
 type mmapTorrentStorage struct {
        infoHash metainfo.Hash
-       span     *mmap_span.MMapSpan
+       span     *mmapSpan.MMapSpan
        pc       PieceCompletionGetSetter
 }
 
@@ -109,7 +109,7 @@ func (sp mmapStoragePiece) MarkNotComplete() error {
        return sp.pc.Set(sp.pieceKey(), false)
 }
 
-func mMapTorrent(md *metainfo.Info, location string) (mms *mmap_span.MMapSpan, err error) {
+func mMapTorrent(md *metainfo.Info, location string) (mms *mmapSpan.MMapSpan, err error) {
        var mMaps []FileMapping
        defer func() {
                if err != nil {
@@ -133,7 +133,7 @@ func mMapTorrent(md *metainfo.Info, location string) (mms *mmap_span.MMapSpan, e
                }
                mMaps = append(mMaps, mm)
        }
-       return mmap_span.New(mMaps, md.FileSegmentsIndex()), nil
+       return mmapSpan.New(mMaps, md.FileSegmentsIndex()), nil
 }
 
 func mmapFile(name string, size int64) (_ FileMapping, err error) {
@@ -198,7 +198,7 @@ func WrapFileMapping(region mmap.MMap, file *os.File) FileMapping {
        }
 }
 
-type FileMapping = mmap_span.Mmap
+type FileMapping = mmapSpan.Mmap
 
 // Handles closing the mmap's file handle (needed for Windows). Could be implemented differently by
 // OS.