Procházet zdrojové kódy

Add more commentary to minNonLiteralBlockSize.

Nigel Tao před 9 roky
rodič
revize
cef980a12b
1 změnil soubory, kde provedl 3 přidání a 0 odebrání
  1. 3 0
      encode.go

+ 3 - 0
encode.go

@@ -160,6 +160,9 @@ const inputMargin = 16 - 1
 //
 // The C++ code doesn't use this exact threshold, but it could, as discussed at
 // https://groups.google.com/d/topic/snappy-compression/oGbhsdIJSJ8/discussion
+// The difference between Go (2+inputMargin) and C++ (inputMargin) is purely an
+// optimization. It should not affect the encoded form. This is tested by
+// TestSameEncodingAsCppShortCopies.
 const minNonLiteralBlockSize = 1 + 1 + inputMargin
 
 func hash(u, shift uint32) uint32 {