mirror of
				https://github.com/TeaOSLab/EdgeNode.git
				synced 2025-11-04 07:40:56 +08:00 
			
		
		
		
	优化MMAP相关功能
This commit is contained in:
		@@ -140,7 +140,7 @@ func TestFileList_Exist(t *testing.T) {
 | 
			
		||||
	}()
 | 
			
		||||
	{
 | 
			
		||||
		var hash = stringutil.Md5("123456")
 | 
			
		||||
		exists, err := list.Exist(hash)
 | 
			
		||||
		exists, _, err := list.Exist(hash)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			t.Fatal(err)
 | 
			
		||||
		}
 | 
			
		||||
@@ -148,7 +148,7 @@ func TestFileList_Exist(t *testing.T) {
 | 
			
		||||
	}
 | 
			
		||||
	{
 | 
			
		||||
		var hash = stringutil.Md5("http://edge.teaos.cn/1234561")
 | 
			
		||||
		exists, err := list.Exist(hash)
 | 
			
		||||
		exists, _, err := list.Exist(hash)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			t.Fatal(err)
 | 
			
		||||
		}
 | 
			
		||||
@@ -208,7 +208,7 @@ func TestFileList_Exist_Many_DB(t *testing.T) {
 | 
			
		||||
					countLocker.Unlock()
 | 
			
		||||
 | 
			
		||||
					var list = listSlice[rands.Int(0, len(listSlice)-1)]
 | 
			
		||||
					_, _ = list.Exist(hash)
 | 
			
		||||
					_, _, _ = list.Exist(hash)
 | 
			
		||||
				default:
 | 
			
		||||
					return
 | 
			
		||||
				}
 | 
			
		||||
@@ -442,6 +442,6 @@ func BenchmarkFileList_Exist(b *testing.B) {
 | 
			
		||||
	}
 | 
			
		||||
	b.ResetTimer()
 | 
			
		||||
	for i := 0; i < b.N; i++ {
 | 
			
		||||
		_, _ = list.Exist("f0eb5b87e0b0041f3917002c0707475f" + types.String(i))
 | 
			
		||||
		_, _, _ = list.Exist("f0eb5b87e0b0041f3917002c0707475f" + types.String(i))
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user