# HG changeset patch
# User Florian Pose <fp@igh-essen.com>
# Date 1201898683 0
# Node ID 9964e7be79ced012a8f2bc1d58dbae01158b8306
# Parent  9736efaac5d5e85ec0ad0ac353892baae4554282
Small improvement of PDO offset calculation.

diff -r 9736efaac5d5 -r 9964e7be79ce master/domain.c
--- a/master/domain.c	Fri Feb 01 20:37:10 2008 +0000
+++ b/master/domain.c	Fri Feb 01 20:44:43 2008 +0000
@@ -200,16 +200,15 @@
 
     // Calculate offset (in sync manager) for process data pointer
     bit_offset = 0;
-    byte_offset = 0;
     list_for_each_entry(other_pdo, &sync->pdos, list) {
         list_for_each_entry(other_entry, &other_pdo->entries, list) {
-            if (other_entry == entry) {
-                byte_offset = bit_offset / 8;
-                break;
-            }
+            if (other_entry == entry)
+                goto out;
             bit_offset += other_entry->bit_length;
         }
     }
+out:
+    byte_offset = bit_offset / 8;
 
     // Allocate memory for data registration object
     if (!(data_reg =