Remove unnecessary parameter element (#4666)
* Stop passing pubkey ref unnecessarily * Cargo.lock
This commit is contained in:
parent
c1f316721a
commit
0da9ac1a47
|
@ -2302,22 +2302,7 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-programs"
|
||||
version = "0.16.0"
|
||||
dependencies = [
|
||||
"bincode 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"elf 0.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"solana-bpfloader 0.16.0",
|
||||
"solana-logger 0.16.0",
|
||||
"solana-runtime 0.16.0",
|
||||
"solana-sdk 0.16.0",
|
||||
"solana_rbpf 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"walkdir 2.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpfloader"
|
||||
name = "solana-bpf-loader-api"
|
||||
version = "0.16.0"
|
||||
dependencies = [
|
||||
"bincode 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -2330,6 +2315,31 @@ dependencies = [
|
|||
"solana_rbpf 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-loader-program"
|
||||
version = "0.16.0"
|
||||
dependencies = [
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"solana-bpf-loader-api 0.16.0",
|
||||
"solana-logger 0.16.0",
|
||||
"solana-sdk 0.16.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-bpf-programs"
|
||||
version = "0.16.0"
|
||||
dependencies = [
|
||||
"bincode 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"elf 0.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"solana-bpf-loader-api 0.16.0",
|
||||
"solana-logger 0.16.0",
|
||||
"solana-runtime 0.16.0",
|
||||
"solana-sdk 0.16.0",
|
||||
"solana_rbpf 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"walkdir 2.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-budget-api"
|
||||
version = "0.16.0"
|
||||
|
@ -2480,7 +2490,8 @@ dependencies = [
|
|||
"serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_yaml 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"solana 0.16.0",
|
||||
"solana-bpfloader 0.16.0",
|
||||
"solana-bpf-loader-api 0.16.0",
|
||||
"solana-bpf-loader-program 0.16.0",
|
||||
"solana-budget-api 0.16.0",
|
||||
"solana-budget-program 0.16.0",
|
||||
"solana-config-api 0.16.0",
|
||||
|
@ -2651,7 +2662,8 @@ dependencies = [
|
|||
"serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"solana-bpfloader 0.16.0",
|
||||
"solana-bpf-loader-api 0.16.0",
|
||||
"solana-bpf-loader-program 0.16.0",
|
||||
"solana-logger 0.16.0",
|
||||
"solana-metrics 0.16.0",
|
||||
"solana-noop-program 0.16.0",
|
||||
|
|
|
@ -435,7 +435,7 @@ impl AccountsDB {
|
|||
fork_id: Fork,
|
||||
accounts: &HashMap<&Pubkey, (&Account, LamportCredit)>,
|
||||
) -> Vec<AccountInfo> {
|
||||
let with_meta: Vec<(StorageMeta, &Pubkey, &Account, u64)> = accounts
|
||||
let with_meta: Vec<(StorageMeta, &Account, u64)> = accounts
|
||||
.iter()
|
||||
.map(|(pubkey, (account, credit))| {
|
||||
let write_version = self.write_version.fetch_add(1, Ordering::Relaxed) as u64;
|
||||
|
@ -457,7 +457,7 @@ impl AccountsDB {
|
|||
lamports += credit;
|
||||
}
|
||||
|
||||
(meta, *pubkey, *account, lamports)
|
||||
(meta, *account, lamports)
|
||||
})
|
||||
.collect();
|
||||
let mut infos: Vec<AccountInfo> = vec![];
|
||||
|
@ -468,7 +468,7 @@ impl AccountsDB {
|
|||
storage.set_status(AccountStorageStatus::Full);
|
||||
continue;
|
||||
}
|
||||
for (offset, (_, _, _, lamports)) in rvs.iter().zip(&with_meta[infos.len()..]) {
|
||||
for (offset, (_, _, lamports)) in rvs.iter().zip(&with_meta[infos.len()..]) {
|
||||
storage.add_account();
|
||||
infos.push(AccountInfo {
|
||||
id: storage.id,
|
||||
|
|
|
@ -220,13 +220,10 @@ impl AppendVec {
|
|||
}
|
||||
|
||||
#[allow(clippy::mutex_atomic)]
|
||||
pub fn append_accounts(
|
||||
&self,
|
||||
accounts: &[(StorageMeta, &Pubkey, &Account, u64)],
|
||||
) -> Vec<usize> {
|
||||
pub fn append_accounts(&self, accounts: &[(StorageMeta, &Account, u64)]) -> Vec<usize> {
|
||||
let mut offset = self.append_offset.lock().unwrap();
|
||||
let mut rv = vec![];
|
||||
for (storage_meta, _, account, lamports) in accounts {
|
||||
for (storage_meta, account, lamports) in accounts {
|
||||
let meta_ptr = storage_meta as *const StorageMeta;
|
||||
let balance = AccountBalance {
|
||||
lamports: *lamports,
|
||||
|
@ -251,7 +248,7 @@ impl AppendVec {
|
|||
}
|
||||
|
||||
pub fn append_account(&self, storage_meta: StorageMeta, account: &Account) -> Option<usize> {
|
||||
self.append_accounts(&[(storage_meta, &Pubkey::default(), account, account.lamports)])
|
||||
self.append_accounts(&[(storage_meta, account, account.lamports)])
|
||||
.first()
|
||||
.cloned()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue