@@ -695,17 +695,11 @@ job_is_active( lListElem *job,
695
695
/* --------------------------------------------------------------------
696
696
* locate_department - locate the department object by name
697
697
*--------------------------------------------------------------------*/
698
-
699
698
static lListElem *
700
- locate_department ( lList *dept_list,
701
- const char *name )
702
- {
703
- if (!name)
699
+ locate_department (lList *dept_list, const char *name) {
700
+ if (name == nullptr ) {
704
701
return nullptr ;
705
-
706
- /* -------------------------------------------------------------
707
- * Look up the department object by name
708
- *-------------------------------------------------------------*/
702
+ }
709
703
710
704
return lGetElemStrRW (dept_list, US_name, name);
711
705
}
@@ -759,8 +753,7 @@ sge_set_job_refs( lListElem *job,
759
753
* locate user object and save off reference
760
754
*-------------------------------------------------------------*/
761
755
762
- ref->user = user_list_locate (lists->user_list ,
763
- lGetString (job, JB_owner));
756
+ ref->user = user_list_locate (lists->user_list , lGetString (job, JB_owner));
764
757
if (ref->user ) {
765
758
lSetUlong (ref->user , UU_job_cnt, 0 );
766
759
lSetUlong (ref->user , UU_pending_job_cnt, 0 );
@@ -770,8 +763,7 @@ sge_set_job_refs( lListElem *job,
770
763
* locate project object and save off reference
771
764
*-------------------------------------------------------------*/
772
765
773
- ref->project = prj_list_locate (lists->project_list ,
774
- lGetString (job, JB_project));
766
+ ref->project = prj_list_locate (lists->project_list , lGetString (job, JB_project));
775
767
if (ref->project ) {
776
768
lSetUlong (ref->project , PR_job_cnt, 0 );
777
769
lSetUlong (ref->project , PR_pending_job_cnt, 0 );
@@ -813,8 +805,7 @@ sge_set_job_refs( lListElem *job,
813
805
* locate department object and save off reference in job entry
814
806
*-------------------------------------------------------------*/
815
807
816
- ref->dept = locate_department (lists->dept_list ,
817
- lGetString (job, JB_department));
808
+ ref->dept = locate_department (lists->dept_list , lGetString (job, JB_department));
818
809
if (ref->dept ) {
819
810
lSetUlong (ref->dept , US_job_cnt, 0 );
820
811
lSetUlong (ref->dept , US_pending_job_cnt, 0 );
@@ -827,9 +818,7 @@ sge_set_job_refs( lListElem *job,
827
818
*--------------------------------------------------------------------*/
828
819
829
820
static void
830
- sge_set_job_cnts ( sge_ref_t *ref,
831
- int queued )
832
- {
821
+ sge_set_job_cnts (sge_ref_t *ref, int queued) {
833
822
int prj_job_cnt_nm = queued ? PR_pending_job_cnt : PR_job_cnt;
834
823
int user_job_cnt_nm = queued ? UU_pending_job_cnt : UU_job_cnt;
835
824
int us_job_cnt_nm = queued ? US_pending_job_cnt : US_job_cnt;
@@ -842,8 +831,6 @@ sge_set_job_cnts( sge_ref_t *ref,
842
831
if (ref->dept ) {
843
832
lAddUlong (ref->dept , us_job_cnt_nm, 1 );
844
833
}
845
-
846
- return ;
847
834
}
848
835
849
836
@@ -852,9 +839,7 @@ sge_set_job_cnts( sge_ref_t *ref,
852
839
*--------------------------------------------------------------------*/
853
840
854
841
static void
855
- sge_unset_job_cnts ( sge_ref_t *ref,
856
- int queued )
857
- {
842
+ sge_unset_job_cnts (sge_ref_t *ref, int queued) {
858
843
int prj_job_cnt_nm = queued ? PR_pending_job_cnt : PR_job_cnt;
859
844
int user_job_cnt_nm = queued ? UU_pending_job_cnt : UU_job_cnt;
860
845
int us_job_cnt_nm = queued ? US_pending_job_cnt : US_job_cnt;
@@ -867,7 +852,6 @@ sge_unset_job_cnts( sge_ref_t *ref,
867
852
if (ref->dept ) {
868
853
lAddUlong (ref->dept , us_job_cnt_nm, -1 );
869
854
}
870
- return ;
871
855
}
872
856
873
857
@@ -1609,10 +1593,7 @@ calc_job_share_tree_tickets_pass2( sge_ref_t *ref, double total_share_tree_ticke
1609
1593
* ???
1610
1594
*******************************************************************************/
1611
1595
static void copy_ftickets (sge_ref_list_t *source, sge_ref_list_t *dest){
1612
- if (source == nullptr || dest == nullptr ) {
1613
- return ;
1614
- }
1615
- else {
1596
+ if (source != nullptr && dest != nullptr ) {
1616
1597
sge_ref_t *dest_r = dest->ref ;
1617
1598
sge_ref_t *source_r = source->ref ;
1618
1599
@@ -2673,7 +2654,7 @@ sge_calc_tickets( scheduler_all_data_t *lists,
2673
2654
}
2674
2655
2675
2656
/* -----------------------------------------------------------------
2676
- * Note: use of the the job_ref_t array assumes that no jobs
2657
+ * Note: use of the job_ref_t array assumes that no jobs
2677
2658
* will be removed from the job lists and the job list order will
2678
2659
* be maintained during the execution of sge_calc_tickets.
2679
2660
*-----------------------------------------------------------------*/
0 commit comments