@@ -942,12 +942,8 @@ public static Conflict git_index_conflict_get(
942
942
943
943
public static int git_index_entrycount ( IndexSafeHandle index )
944
944
{
945
- UIntPtr count = NativeMethods . git_index_entrycount ( index ) ;
946
- if ( ( long ) count > int . MaxValue )
947
- {
948
- throw new LibGit2SharpException ( "Index entry count exceeds size of int" ) ;
949
- }
950
- return ( int ) count ;
945
+ return NativeMethods . git_index_entrycount ( index )
946
+ . ConvertToInt ( ) ;
951
947
}
952
948
953
949
public static StageLevel git_index_entry_stage ( IndexEntrySafeHandle index )
@@ -982,12 +978,8 @@ public static bool git_index_has_conflicts(IndexSafeHandle index)
982
978
983
979
public static int git_index_name_entrycount ( IndexSafeHandle index )
984
980
{
985
- uint count = NativeMethods . git_index_name_entrycount ( index ) ;
986
- if ( ( long ) count > int . MaxValue )
987
- {
988
- throw new LibGit2SharpException ( "Index name entry count exceeds size of int" ) ;
989
- }
990
- return ( int ) count ;
981
+ return NativeMethods . git_index_name_entrycount ( index )
982
+ . ConvertToInt ( ) ;
991
983
}
992
984
993
985
public static IndexNameEntrySafeHandle git_index_name_get_byindex ( IndexSafeHandle index , UIntPtr n )
@@ -1027,12 +1019,8 @@ public static void git_index_remove_bypath(IndexSafeHandle index, FilePath path)
1027
1019
1028
1020
public static int git_index_reuc_entrycount ( IndexSafeHandle index )
1029
1021
{
1030
- uint count = NativeMethods . git_index_reuc_entrycount ( index ) ;
1031
- if ( ( long ) count > int . MaxValue )
1032
- {
1033
- throw new LibGit2SharpException ( "Index REUC entry count exceeds size of int" ) ;
1034
- }
1035
- return ( int ) count ;
1022
+ return NativeMethods . git_index_reuc_entrycount ( index )
1023
+ . ConvertToInt ( ) ;
1036
1024
}
1037
1025
1038
1026
public static IndexReucEntrySafeHandle git_index_reuc_get_byindex ( IndexSafeHandle index , UIntPtr n )
0 commit comments