mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 08:45:41 +08:00
refactor(state/proxy): use Box<Value> for providers_proxies to reduce struct size
- Changed providers_proxies from Value to Box<Value> in CmdProxyState - Reduces struct size from 32 bytes to 8 bytes, optimizing memory usage
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
use serde_json::Value;
|
||||
|
||||
pub struct CmdProxyState {
|
||||
pub last_refresh_time: std::time::Instant,
|
||||
pub need_refresh: bool,
|
||||
pub proxies: serde_json::Value,
|
||||
pub providers_proxies: serde_json::Value,
|
||||
pub proxies: Box<Value>,
|
||||
pub providers_proxies: Box<Value>,
|
||||
}
|
||||
|
||||
impl Default for CmdProxyState {
|
||||
@@ -10,8 +12,8 @@ impl Default for CmdProxyState {
|
||||
Self {
|
||||
last_refresh_time: std::time::Instant::now(),
|
||||
need_refresh: true,
|
||||
proxies: serde_json::Value::Null,
|
||||
providers_proxies: serde_json::Value::Null,
|
||||
proxies: Box::new(Value::Null),
|
||||
providers_proxies: Box::new(Value::Null),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user