Skip to content

Commit 4a441ec

Browse files
committed
Avoid parsing in Basic lookup
1 parent 96ad878 commit 4a441ec

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/NHibernate/Type/TypeFactory.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,11 @@ public static IType Basic(string name)
404404
/// This method will return null if the name is not found in the basicNameMap.
405405
/// </remarks>
406406
public static IType Basic(string name, IDictionary<string, string> parameters)
407+
{
408+
return Basic(name, parameters, parseName: true);
409+
}
410+
411+
private static IType Basic(string name, IDictionary<string, string> parameters, bool parseName)
407412
{
408413
string typeName;
409414

@@ -426,6 +431,9 @@ public static IType Basic(string name, IDictionary<string, string> parameters)
426431
return returnType;
427432
}
428433

434+
if (!parseName)
435+
return null;
436+
429437
// if we get to here then the basic type with the length or precision/scale
430438
// combination doesn't exists - so lets figure out which one we have and
431439
// invoke the appropriate delegate
@@ -593,7 +601,7 @@ private static IType HeuristicType(System.Type typeClass, IDictionary<string, st
593601
{
594602
if(tryBasic)
595603
{
596-
IType type = Basic(typeClass.AssemblyQualifiedName, parameters);
604+
IType type = Basic(typeClass.AssemblyQualifiedName, parameters, parseName: false);
597605

598606
if (type != null)
599607
return type;

0 commit comments

Comments
 (0)