From f68d32c9f4b2f46d26d96839801d1888a93f93ed Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期四, 18 一月 2024 14:25:29 +0800
Subject: [PATCH] less memory

---
 api/bhsgo/bhome_node.go |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/api/bhsgo/bhome_node.go b/api/bhsgo/bhome_node.go
index 6ea1b70..4a729a4 100644
--- a/api/bhsgo/bhome_node.go
+++ b/api/bhsgo/bhome_node.go
@@ -15,7 +15,10 @@
 )
 
 func unsafeGetBytes(p *unsafe.Pointer, s int) []byte {
-	fmt.Println("creply", *p, "len", s)
+	if *p == nil || s == 0 {
+		return nil
+	}
+	fmt.Println("unsafeGetBytes creply", *p, "len", s)
 	d := (*[0x7fffffff]byte)(*p)[:s:s]
 	return d
 }

--
Gitblit v1.8.0