Skip to content

Commit 0e74f86

Browse files
committed
Syntax cleanup
1 parent 26ce7d8 commit 0e74f86

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/runtime/importhook.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ internal static void Initialize()
7171
/// </summary>
7272
internal static void Shutdown()
7373
{
74-
if (0 != Runtime.Py_IsInitialized())
74+
if (Runtime.Py_IsInitialized() != 0)
7575
{
7676
Runtime.XDecref(py_clr_module);
7777
Runtime.XDecref(root.pyHandle);
@@ -111,11 +111,11 @@ public static IntPtr GetCLRModule(IntPtr? fromList = null)
111111
continue;
112112

113113
string s = item.AsManagedObject(typeof(string)) as string;
114-
if (null == s)
114+
if (s == null)
115115
continue;
116116

117117
ManagedType attr = root.GetAttribute(s, true);
118-
if (null == attr)
118+
if (attr == null)
119119
continue;
120120

121121
Runtime.XIncref(attr.pyHandle);
@@ -190,7 +190,7 @@ public static IntPtr __import__(IntPtr self, IntPtr args, IntPtr kw)
190190
}
191191
if (mod_name == "CLR")
192192
{
193-
Exceptions.deprecation("The CLR module is deprecated. " + "Please use 'clr'.");
193+
Exceptions.deprecation("The CLR module is deprecated. Please use 'clr'.");
194194
IntPtr clr_module = GetCLRModule(fromList);
195195
if (clr_module != IntPtr.Zero)
196196
{
@@ -305,9 +305,8 @@ public static IntPtr __import__(IntPtr self, IntPtr args, IntPtr kw)
305305
ModuleObject tail = root;
306306
root.InitializePreload();
307307

308-
for (int i = 0; i < names.Length; i++)
308+
foreach (string name in names)
309309
{
310-
string name = names[i];
311310
ManagedType mt = tail.GetAttribute(name, true);
312311
if (!(mt is ModuleObject))
313312
{

0 commit comments

Comments
 (0)