@@ -942,12 +942,8 @@ public static Conflict git_index_conflict_get(
942942
943943 public static int git_index_entrycount ( IndexSafeHandle index )
944944 {
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 ( ) ;
951947 }
952948
953949 public static StageLevel git_index_entry_stage ( IndexEntrySafeHandle index )
@@ -982,12 +978,8 @@ public static bool git_index_has_conflicts(IndexSafeHandle index)
982978
983979 public static int git_index_name_entrycount ( IndexSafeHandle index )
984980 {
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 ( ) ;
991983 }
992984
993985 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)
10271019
10281020 public static int git_index_reuc_entrycount ( IndexSafeHandle index )
10291021 {
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 ( ) ;
10361024 }
10371025
10381026 public static IndexReucEntrySafeHandle git_index_reuc_get_byindex ( IndexSafeHandle index , UIntPtr n )
0 commit comments