Fixes code according to modern code style. Fixes a few expression bugs.

This commit is contained in:
Kamron Batman 2018-09-15 09:58:51 -07:00
parent 89eea25e5f
commit 970fd563b2
3324 changed files with 441118 additions and 433755 deletions

View file

@ -21,28 +21,28 @@
using System;
using System.Collections.Generic;
namespace Server.Diagnostics {
public class TargetProfile : BaseProfile {
private static Dictionary<Type, TargetProfile> _profiles = new Dictionary<Type, TargetProfile>();
namespace Server.Diagnostics
{
public class TargetProfile : BaseProfile
{
private static Dictionary<Type, TargetProfile> _profiles = new Dictionary<Type, TargetProfile>();
public static IEnumerable<TargetProfile> Profiles => _profiles.Values;
public TargetProfile(Type type)
: base(type.FullName)
{
}
public static TargetProfile Acquire( Type type ) {
if ( !Core.Profiling ) {
return null;
}
public static IEnumerable<TargetProfile> Profiles => _profiles.Values;
TargetProfile prof;
public static TargetProfile Acquire(Type type)
{
if (!Core.Profiling) return null;
if ( !_profiles.TryGetValue( type, out prof ) ) {
_profiles.Add( type, prof = new TargetProfile( type ) );
}
TargetProfile prof;
return prof;
}
if (!_profiles.TryGetValue(type, out prof)) _profiles.Add(type, prof = new TargetProfile(type));
public TargetProfile( Type type )
: base( type.FullName ) {
}
}
return prof;
}
}
}