Change dict() to {}

This commit changes dict() invocations to {}
as it has been found to be better in performance.

Change-Id: Id44ea76036a00d1901456c48f65711b3bf84c603
This commit is contained in:
Ramakrishnan G
2015-06-26 03:53:42 +00:00
parent 3be340686b
commit 4c3b5c15df
4 changed files with 17 additions and 17 deletions

View File

@@ -58,7 +58,7 @@ def _get_key_value(string):
def _get_dict(lines, start_index, indentation):
"""Recursive function for parsing hpssacli output."""
info = dict()
info = {}
current_item = None
i = start_index
@@ -69,7 +69,7 @@ def _get_dict(lines, start_index, indentation):
if current_line_indentation == indentation:
current_item = current_line.lstrip(' ')
info[current_item] = dict()
info[current_item] = {}
i = i + 1
continue
@@ -312,7 +312,7 @@ class Controller(object):
self.unassigned_physical_drives = []
self.raid_arrays = []
unassigned_drives = properties.get('unassigned', dict())
unassigned_drives = properties.get('unassigned', {})
for key, value in unassigned_drives.items():
self.unassigned_physical_drives.append(PhysicalDrive(key,
value,