From 2ffad62529bdc4ca6afc95c5ef9a7144b5974ec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Wed, 28 Oct 2020 13:48:15 +0100 Subject: [PATCH] Make sure to use the optimized method instead of reading the storage. (#7445) --- substrate/frame/support/src/storage/unhashed.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substrate/frame/support/src/storage/unhashed.rs b/substrate/frame/support/src/storage/unhashed.rs index 34b146b86f..42f21cab49 100644 --- a/substrate/frame/support/src/storage/unhashed.rs +++ b/substrate/frame/support/src/storage/unhashed.rs @@ -83,7 +83,7 @@ pub fn take_or_else T>(key: &[u8], default_val /// Check to see if `key` has an explicit entry in storage. pub fn exists(key: &[u8]) -> bool { - sp_io::storage::read(key, &mut [0;0][..], 0).is_some() + sp_io::storage::exists(key) } /// Ensure `key` has no explicit entry in storage.