get_avail_core_count(): made code more compact