aboutsummaryrefslogtreecommitdiff
path: root/oid
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-02-20 22:37:34 +0800
committerGravatar Runxi Yu2026-02-20 22:37:34 +0800
commit6cf63c5de9bb7f894d752caf72ab8326ac0c25da (patch)
tree21f6e016d1db0b95109cae48f42645bd7309f3b9 /oid
parentobject: I guess these checks are unnecessary (diff)
signatureNo signature
oid: Remove these unnecessary checks too
Diffstat (limited to 'oid')
-rw-r--r--oid/objectid.go6
1 files changed, 0 insertions, 6 deletions
diff --git a/oid/objectid.go b/oid/objectid.go
index 92031d92..6507306e 100644
--- a/oid/objectid.go
+++ b/oid/objectid.go
@@ -141,18 +141,12 @@ func (id ObjectID) Size() int {
// String returns the canonical hex representation.
func (id ObjectID) String() string {
size := id.Size()
- if size == 0 {
- return ""
- }
return hex.EncodeToString(id.data[:size])
}
// Bytes returns a copy of the object ID bytes.
func (id ObjectID) Bytes() []byte {
size := id.Size()
- if size == 0 {
- return nil
- }
return append([]byte(nil), id.data[:size]...)
}