Early exit if buffered packets is empty

This commit is contained in:
Stephen Akridge 2019-03-29 11:20:36 -07:00 committed by sakridge
parent 8e04fadb05
commit 0887832b00
1 changed files with 4 additions and 0 deletions

View File

@ -115,6 +115,10 @@ impl BankingStage {
cluster_info: &Arc<RwLock<ClusterInfo>>, cluster_info: &Arc<RwLock<ClusterInfo>>,
buffered_packets: &[(SharedPackets, usize)], buffered_packets: &[(SharedPackets, usize)],
) -> bool { ) -> bool {
if buffered_packets.is_empty() {
return false;
}
let rcluster_info = cluster_info.read().unwrap(); let rcluster_info = cluster_info.read().unwrap();
// If there's a bank, and leader is available, forward the buffered packets // If there's a bank, and leader is available, forward the buffered packets