sync: compress two if statements
No functional changes, just merges a > and == condition into a >= condition. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
		
							parent
							
								
									7cf1b595c8
								
							
						
					
					
						commit
						5c7cfd4c69
					
				
							
								
								
									
										31
									
								
								Xext/sync.c
								
								
								
								
							
							
						
						
									
										31
									
								
								Xext/sync.c
								
								
								
								
							| 
						 | 
					@ -1031,17 +1031,10 @@ SyncComputeBracketValues(SyncCounter * pCounter)
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else if (pTrigger->test_type == XSyncNegativeTransition &&
 | 
					        else if (pTrigger->test_type == XSyncNegativeTransition &&
 | 
				
			||||||
                 ct != XSyncCounterNeverIncreases) {
 | 
					                 ct != XSyncCounterNeverIncreases) {
 | 
				
			||||||
            if (XSyncValueGreaterThan(pCounter->value, pTrigger->test_value) &&
 | 
					            if (XSyncValueGreaterOrEqual(pCounter->value, pTrigger->test_value) &&
 | 
				
			||||||
                XSyncValueGreaterThan(pTrigger->test_value, psci->bracket_less))
 | 
					                XSyncValueGreaterThan(pTrigger->test_value, psci->bracket_less)) {
 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                psci->bracket_less = pTrigger->test_value;
 | 
					 | 
				
			||||||
                pnewltval = &psci->bracket_less;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) &&
 | 
					 | 
				
			||||||
                     XSyncValueGreaterThan(pTrigger->test_value,
 | 
					 | 
				
			||||||
                                           psci->bracket_less)) {
 | 
					 | 
				
			||||||
                    /*
 | 
					                    /*
 | 
				
			||||||
                 * The value is exactly equal to our threshold.  We want one
 | 
					                     * If the value is exactly equal to our threshold, we want one
 | 
				
			||||||
                     * more event in the negative direction to ensure we pick up
 | 
					                     * more event in the negative direction to ensure we pick up
 | 
				
			||||||
                     * when the value is less than this threshold.
 | 
					                     * when the value is less than this threshold.
 | 
				
			||||||
                     */
 | 
					                     */
 | 
				
			||||||
| 
						 | 
					@ -1051,19 +1044,13 @@ SyncComputeBracketValues(SyncCounter * pCounter)
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else if (pTrigger->test_type == XSyncPositiveTransition &&
 | 
					        else if (pTrigger->test_type == XSyncPositiveTransition &&
 | 
				
			||||||
                 ct != XSyncCounterNeverDecreases) {
 | 
					                 ct != XSyncCounterNeverDecreases) {
 | 
				
			||||||
            if (XSyncValueLessThan(pCounter->value, pTrigger->test_value) &&
 | 
					            if (XSyncValueLessOrEqual(pCounter->value, pTrigger->test_value) &&
 | 
				
			||||||
                XSyncValueLessThan(pTrigger->test_value, psci->bracket_greater))
 | 
					                XSyncValueLessThan(pTrigger->test_value, psci->bracket_greater)) {
 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                psci->bracket_greater = pTrigger->test_value;
 | 
					 | 
				
			||||||
                pnewgtval = &psci->bracket_greater;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) &&
 | 
					 | 
				
			||||||
                     XSyncValueLessThan(pTrigger->test_value,
 | 
					 | 
				
			||||||
                                        psci->bracket_greater)) {
 | 
					 | 
				
			||||||
                    /*
 | 
					                    /*
 | 
				
			||||||
                 * The value is exactly equal to our threshold.  We want one
 | 
					                     * If the value is exactly equal to our threshold, we
 | 
				
			||||||
                 * more event in the positive direction to ensure we pick up
 | 
					                     * want one more event in the positive direction to
 | 
				
			||||||
                 * when the value *exceeds* this threshold.
 | 
					                     * ensure we pick up when the value *exceeds* this
 | 
				
			||||||
 | 
					                     * threshold.
 | 
				
			||||||
                     */
 | 
					                     */
 | 
				
			||||||
                    psci->bracket_greater = pTrigger->test_value;
 | 
					                    psci->bracket_greater = pTrigger->test_value;
 | 
				
			||||||
                    pnewgtval = &psci->bracket_greater;
 | 
					                    pnewgtval = &psci->bracket_greater;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue